diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-07 13:28:44 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-07 13:28:44 +0000 |
commit | 179b27be1e4cf4e68ccb9df64c64156dbb7b3820 (patch) | |
tree | 656b95c0086c4c552c43914f47b3c292b0276618 /apt-private | |
parent | Adding upstream version 2.9.6. (diff) | |
download | apt-179b27be1e4cf4e68ccb9df64c64156dbb7b3820.tar.xz apt-179b27be1e4cf4e68ccb9df64c64156dbb7b3820.zip |
Adding upstream version 2.9.7.upstream/2.9.7
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'apt-private')
-rw-r--r-- | apt-private/private-cmndline.cc | 2 | ||||
-rw-r--r-- | apt-private/private-install.cc | 2 | ||||
-rw-r--r-- | apt-private/private-main.cc | 2 | ||||
-rw-r--r-- | apt-private/private-output.cc | 10 | ||||
-rw-r--r-- | apt-private/private-output.h | 2 |
5 files changed, 16 insertions, 2 deletions
diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index 592ebd9..ac792cb 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -353,11 +353,13 @@ static bool addArgumentsAPT(std::vector<CommandLine::Args> &Args, char const * c addArg(0,"manual-installed","APT::Cmd::Manual-Installed",0); addArg('v', "verbose", "APT::Cmd::List-Include-Summary", 0); addArg('a', "all-versions", "APT::Cmd::All-Versions", 0); + addArg('S', "snapshot", "APT::Snapshot", CommandLine::HasArg); } else if (CmdMatches("show") || CmdMatches("info")) { addArg('a', "all-versions", "APT::Cache::AllVersions", 0); addArg('f', "full", "APT::Cache::ShowFull", 0); + addArg('S', "snapshot", "APT::Snapshot", CommandLine::HasArg); } else if (addArgumentsAPTGet(Args, Cmd) || addArgumentsAPTCache(Args, Cmd)) { diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index 599caac..57b5c0d 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -729,7 +729,7 @@ bool DoAutomaticRemove(CacheFile &Cache) "The following packages were automatically installed and are no longer required:", autoRemoveCount), Universe, [&Cache](pkgCache::PkgIterator const &Pkg) { return (*Cache)[Pkg].Garbage == true && (*Cache)[Pkg].Delete() == false; }, - &PrettyFullName, CandidateVersion(&Cache), "", note); + &PrettyFullName, CurrentVersion(&Cache), "", note); } else { diff --git a/apt-private/private-main.cc b/apt-private/private-main.cc index f28f5cb..39ad07b 100644 --- a/apt-private/private-main.cc +++ b/apt-private/private-main.cc @@ -81,6 +81,8 @@ void CheckIfCalledByScript(int argc, const char *argv[]) /*{{{*/ if(!isatty(STDOUT_FILENO) && _config->FindB("Apt::Cmd::Disable-Script-Warning", false) == false) { + // NOTE: CLI interface is redundant on the I/interface, this is + // intentional to make it easier to read. std::cerr << std::endl << "WARNING: " << flNotDir(argv[0]) << " " << "does not have a stable CLI interface. " diff --git a/apt-private/private-output.cc b/apt-private/private-output.cc index 2e81095..4a946f2 100644 --- a/apt-private/private-output.cc +++ b/apt-private/private-output.cc @@ -596,7 +596,7 @@ void ShowDel(ostream &out,CacheFile &Cache) str.append("*"); return str; }, - CandidateVersion(&Cache), + CurrentVersion(&Cache), "action::remove"); } /*}}}*/ @@ -888,6 +888,14 @@ std::string PrettyFullName(pkgCache::PkgIterator const &Pkg) { return Pkg.FullName(true); } +std::string CurrentVersion(pkgCacheFile * const Cache, pkgCache::PkgIterator const &Pkg) +{ + return (*Cache)[Pkg].CurVersion; +} +std::function<std::string(pkgCache::PkgIterator const &)> CurrentVersion(pkgCacheFile * const Cache) +{ + return std::bind(static_cast<std::string(*)(pkgCacheFile * const, pkgCache::PkgIterator const&)>(&CurrentVersion), Cache, std::placeholders::_1); +} std::string CandidateVersion(pkgCacheFile * const Cache, pkgCache::PkgIterator const &Pkg) { return (*Cache)[Pkg].CandVersion; diff --git a/apt-private/private-output.h b/apt-private/private-output.h index 0eba6f4..8e1d472 100644 --- a/apt-private/private-output.h +++ b/apt-private/private-output.h @@ -132,6 +132,8 @@ 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); APT_PUBLIC std::string PrettyFullName(pkgCache::PkgIterator const &Pkg); +std::string CurrentVersion(pkgCacheFile * const Cache, pkgCache::PkgIterator const &Pkg); +std::function<std::string(pkgCache::PkgIterator const &)> CurrentVersion(pkgCacheFile * const Cache); 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); |