diff options
Diffstat (limited to 'apt-private')
-rw-r--r-- | apt-private/private-cmndline.cc | 15 | ||||
-rw-r--r-- | apt-private/private-download.cc | 2 | ||||
-rw-r--r-- | apt-private/private-install.cc | 6 | ||||
-rw-r--r-- | apt-private/private-json-hooks.cc | 2 | ||||
-rw-r--r-- | apt-private/private-output.h | 4 |
5 files changed, 21 insertions, 8 deletions
diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index 5ad3b65d3..87deb6bf0 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -176,7 +176,7 @@ static bool addArgumentsAPTHelper(std::vector<CommandLine::Args> &Args, char con static bool addArgumentsAPTGet(std::vector<CommandLine::Args> &Args, char const * const Cmd)/*{{{*/ { if (CmdMatches("install", "remove", "purge", "upgrade", "dist-upgrade", - "dselect-upgrade", "autoremove", "full-upgrade")) + "dselect-upgrade", "autoremove", "autopurge", "full-upgrade")) { addArg(0, "show-progress", "DpkgPM::Progress", 0); addArg('f', "fix-broken", "APT::Get::Fix-Broken", 0); @@ -240,7 +240,7 @@ static bool addArgumentsAPTGet(std::vector<CommandLine::Args> &Args, char const addArg(0, "color", "APT::Moo::Color", 0); if (CmdMatches("install", "remove", "purge", "upgrade", "dist-upgrade", - "dselect-upgrade", "autoremove", "auto-remove", "clean", "autoclean", "auto-clean", "check", + "dselect-upgrade", "autoremove", "auto-remove", "autopurge", "clean", "autoclean", "auto-clean", "check", "build-dep", "full-upgrade", "source")) { addArg('s', "simulate", "APT::Get::Simulate", 0); @@ -287,7 +287,7 @@ static bool addArgumentsAPTMark(std::vector<CommandLine::Args> &Args, char const { if (CmdMatches("auto", "manual", "hold", "unhold", "showauto", "showmanual", "showhold", "showholds", - "markauto", "unmarkauto")) + "markauto", "unmarkauto", "minimize-manual")) { addArg('f',"file","Dir::State::extended_states",CommandLine::HasArg); } @@ -303,7 +303,14 @@ static bool addArgumentsAPTMark(std::vector<CommandLine::Args> &Args, char const addArg('v',"verbose","APT::MarkAuto::Verbose",0); } - if (Cmd != nullptr && strncmp(Cmd, "show", strlen("show")) != 0) + if (CmdMatches("minimize-manual")) + { + addArg('y',"yes","APT::Get::Assume-Yes",0); + addArg('y',"assume-yes","APT::Get::Assume-Yes",0); + addArg(0,"assume-no","APT::Get::Assume-No",0); + } + + if (CmdMatches("minimize-manual") || (Cmd != nullptr && strncmp(Cmd, "show", strlen("show")) != 0)) { addArg('s',"simulate","APT::Mark::Simulate",0); addArg('s',"just-print","APT::Mark::Simulate",0); diff --git a/apt-private/private-download.cc b/apt-private/private-download.cc index 8bd7e33e0..2c12676ea 100644 --- a/apt-private/private-download.cc +++ b/apt-private/private-download.cc @@ -248,7 +248,7 @@ bool DoChangelog(CommandLine &CmdL) APT::VersionList verset = APT::VersionList::FromCommandLine(Cache, CmdL.FileList + 1, APT::CacheSetHelper::CANDIDATE, helper); if (verset.empty() == true) - return false; + return _error->Error(_("No packages found")); bool const downOnly = _config->FindB("APT::Get::Download-Only", false); bool const printOnly = _config->FindB("APT::Get::Print-URIs", false); diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index 4e888a9bd..1713ff308 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -599,6 +599,12 @@ bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, std::vector<PseudoPkg _config->Set("APT::Get::AutomaticRemove", "true"); fallback = MOD_REMOVE; } + else if (strcasecmp(CmdL.FileList[0], "autopurge") == 0) + { + _config->Set("APT::Get::AutomaticRemove", "true"); + _config->Set("APT::Get::Purge", true); + fallback = MOD_REMOVE; + } std::list<APT::VersionSet::Modifier> mods; mods.push_back(APT::VersionSet::Modifier(MOD_INSTALL, "+", diff --git a/apt-private/private-json-hooks.cc b/apt-private/private-json-hooks.cc index 0e4b4913b..b5c1a7172 100644 --- a/apt-private/private-json-hooks.cc +++ b/apt-private/private-json-hooks.cc @@ -176,7 +176,7 @@ class APT_HIDDEN JsonWriter }; /** - * @brief Wrtie a VerIterator to a JsonWriter + * @brief Write a VerIterator to a JsonWriter */ static void verIterToJson(JsonWriter &writer, CacheFile &Cache, pkgCache::VerIterator const &Ver) { diff --git a/apt-private/private-output.h b/apt-private/private-output.h index 1ac861328..c20cc9e17 100644 --- a/apt-private/private-output.h +++ b/apt-private/private-output.h @@ -101,11 +101,11 @@ bool ShowEssential(std::ostream &out,CacheFile &Cache); void Stats(std::ostream &out, pkgDepCache &Dep); // prompting -bool YnPrompt(char const * const Question, bool Default=true); +APT_PUBLIC bool YnPrompt(char const *const Question, bool Default = true); bool YnPrompt(char const * const Question, bool const Default, bool const ShowGlobalErrors, std::ostream &c1o, std::ostream &c2o); bool AnalPrompt(std::string const &Question, const char *Text); -std::string PrettyFullName(pkgCache::PkgIterator const &Pkg); +APT_PUBLIC std::string PrettyFullName(pkgCache::PkgIterator const &Pkg); std::string CandidateVersion(pkgCacheFile * const Cache, pkgCache::PkgIterator const &Pkg); std::function<std::string(pkgCache::PkgIterator const &)> CandidateVersion(pkgCacheFile * const Cache); std::string CurrentToCandidateVersion(pkgCacheFile * const Cache, pkgCache::PkgIterator const &Pkg); |