From 385d9f2f23057bc5808b5e013e77ba16d1c94da4 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 7 Jun 2016 17:01:33 +0200 Subject: edsp: optionally store a compressed copy of the last scenario For bugreports and co it could be handy to have the scenario and all the settings used in it around later for inspection for EDSP like protocols. EDSP might not be the most interesting as the user can still interrupt the process before the solution is applied and users tend to have an opinion on the "rightness" of a solution, so it is disabled by default. --- apt-private/private-cmndline.cc | 20 ++++++++++++++------ apt-private/private-cmndline.h | 1 + apt-private/private-main.cc | 1 + 3 files changed, 16 insertions(+), 6 deletions(-) (limited to 'apt-private') diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index 7e50b1401..135ee3c4e 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -128,6 +128,11 @@ static bool addArgumentsAPTConfig(std::vector &Args, char con else return false; + return true; +} + /*}}}*/ +static bool addArgumentsAPTDumpSolver(std::vector &, char const * const)/*{{{*/ +{ return true; } /*}}}*/ @@ -347,6 +352,7 @@ std::vector getCommandArgs(APT_CMD const Program, char const case APT_CMD::APT_CACHE: addArgumentsAPTCache(Args, Cmd); break; case APT_CMD::APT_CDROM: addArgumentsAPTCDROM(Args, Cmd); break; case APT_CMD::APT_CONFIG: addArgumentsAPTConfig(Args, Cmd); break; + case APT_CMD::APT_DUMP_SOLVER: addArgumentsAPTDumpSolver(Args, Cmd); break; case APT_CMD::APT_EXTRACTTEMPLATES: addArgumentsAPTExtractTemplates(Args, Cmd); break; case APT_CMD::APT_FTPARCHIVE: addArgumentsAPTFTPArchive(Args, Cmd); break; case APT_CMD::APT_HELPER: addArgumentsAPTHelper(Args, Cmd); break; @@ -402,6 +408,7 @@ static bool ShowCommonHelp(APT_CMD const Binary, CommandLine &CmdL, std::vector< case APT_CMD::APT_CACHE: cmd = "apt-cache(8)"; break; case APT_CMD::APT_CDROM: cmd = "apt-cdrom(8)"; break; case APT_CMD::APT_CONFIG: cmd = "apt-config(8)"; break; + case APT_CMD::APT_DUMP_SOLVER: cmd = nullptr; break; case APT_CMD::APT_EXTRACTTEMPLATES: cmd = "apt-extracttemplates(1)"; break; case APT_CMD::APT_FTPARCHIVE: cmd = "apt-ftparchive(1)"; break; case APT_CMD::APT_GET: cmd = "apt-get(8)"; break; @@ -412,14 +419,15 @@ static bool ShowCommonHelp(APT_CMD const Binary, CommandLine &CmdL, std::vector< } if (cmd != nullptr) ioprintf(std::cout, _("See %s for more information about the available commands."), cmd); - std::cout << std::endl << - _("Configuration options and syntax is detailed in apt.conf(5).\n" - "Information about how to configure sources can be found in sources.list(5).\n" - "Package and version choices can be expressed via apt_preferences(5).\n" - "Security details are available in apt-secure(8).\n"); + if (Binary != APT_CMD::APT_DUMP_SOLVER && Binary != APT_CMD::APT_INTERNAL_SOLVER) + std::cout << std::endl << + _("Configuration options and syntax is detailed in apt.conf(5).\n" + "Information about how to configure sources can be found in sources.list(5).\n" + "Package and version choices can be expressed via apt_preferences(5).\n" + "Security details are available in apt-secure(8).\n"); if (Binary == APT_CMD::APT_GET || Binary == APT_CMD::APT) std::cout << std::right << std::setw(70) << _("This APT has Super Cow Powers.") << std::endl; - else if (Binary == APT_CMD::APT_HELPER) + else if (Binary == APT_CMD::APT_HELPER || Binary == APT_CMD::APT_DUMP_SOLVER) std::cout << std::right << std::setw(70) << _("This APT helper has Super Meep Powers.") << std::endl; return true; } diff --git a/apt-private/private-cmndline.h b/apt-private/private-cmndline.h index 6235ef9f5..c0c5a7455 100644 --- a/apt-private/private-cmndline.h +++ b/apt-private/private-cmndline.h @@ -21,6 +21,7 @@ enum class APT_CMD { APT_INTERNAL_SOLVER, APT_MARK, APT_SORTPKG, + APT_DUMP_SOLVER, }; struct aptDispatchWithHelp { diff --git a/apt-private/private-main.cc b/apt-private/private-main.cc index d6517dd2a..5a5940b7e 100644 --- a/apt-private/private-main.cc +++ b/apt-private/private-main.cc @@ -34,6 +34,7 @@ void InitLocale(APT_CMD const binary) /*{{{*/ case APT_CMD::APT_MARK: textdomain("apt"); break; + case APT_CMD::APT_DUMP_SOLVER: case APT_CMD::APT_EXTRACTTEMPLATES: case APT_CMD::APT_FTPARCHIVE: case APT_CMD::APT_INTERNAL_SOLVER: -- cgit v1.2.3