From 851b6a097165af4d51c0db01b5e05256e5006896 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:00:48 +0200 Subject: Adding upstream version 2.6.1. Signed-off-by: Daniel Baumann --- apt-private/private-install.h | 81 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 apt-private/private-install.h (limited to 'apt-private/private-install.h') diff --git a/apt-private/private-install.h b/apt-private/private-install.h new file mode 100644 index 0000000..0f6d048 --- /dev/null +++ b/apt-private/private-install.h @@ -0,0 +1,81 @@ +#ifndef APT_PRIVATE_INSTALL_H +#define APT_PRIVATE_INSTALL_H + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +class CacheFile; +class CommandLine; +class pkgProblemResolver; + +APT_PUBLIC bool DoInstall(CommandLine &Cmd); + +struct PseudoPkg +{ + std::string name; + std::string arch; + std::string release; + ssize_t index; + PseudoPkg(std::string const &n, std::string const &a, std::string const &r) : name(n), arch(a), release(r), index(-1) {} + PseudoPkg(std::string const &n, std::string const &a, std::string const &r, ssize_t i) : name(n), arch(a), release(r), index(i) {} +}; +std::vector GetAllPackagesAsPseudo(pkgSourceList *const SL, CommandLine &CmdL, bool (*Add)(pkgSourceList *const, PseudoPkg &&, std::vector &), std::string const &pseudoArch); +std::vector GetPseudoPackages(pkgSourceList *const SL, CommandLine &CmdL, bool (*Add)(pkgSourceList *const, PseudoPkg &&, std::vector &), std::string const &pseudoArch); +bool AddVolatileBinaryFile(pkgSourceList *const SL, PseudoPkg &&pkg, std::vector &VolatileCmdL); +bool AddVolatileSourceFile(pkgSourceList *const SL, PseudoPkg &&pkg, std::vector &VolatileCmdL); + +bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, std::vector &VolatileCmdL, CacheFile &Cache, + std::map &verset, int UpgradeMode, + std::set &UnknownPackages, APT::PackageVector &HeldBackPackages); +bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, std::vector &VolatileCmdL, CacheFile &Cache, int UpgradeMode, + APT::PackageVector &HeldBackPackages); + +APT_PUBLIC bool InstallPackages(CacheFile &Cache, + APT::PackageVector &HeldBackPackages, + bool ShwKept, bool Ask = true, + bool Safety = true, + std::string const &Hook = "", + CommandLine const &CmdL = {}); + +bool CheckNothingBroken(CacheFile &Cache); +bool DoAutomaticRemove(CacheFile &Cache); + +// TryToInstall - Mark a package for installation /*{{{*/ +struct TryToInstall { + pkgCacheFile* Cache; + pkgProblemResolver* Fix; + bool FixBroken; + unsigned long AutoMarkChanged; + APT::PackageVector doAutoInstallLater; + + TryToInstall(pkgCacheFile &Cache, pkgProblemResolver *PM, bool const FixBroken) : Cache(&Cache), Fix(PM), + FixBroken(FixBroken), AutoMarkChanged(0) {}; + + void operator() (pkgCache::VerIterator const &Ver); + bool propagateReleaseCandidateSwitching(std::list > const &start, std::ostream &out); + void doAutoInstall(); +}; + /*}}}*/ +// TryToRemove - Mark a package for removal /*{{{*/ +struct TryToRemove { + pkgCacheFile* Cache; + pkgProblemResolver* Fix; + bool PurgePkgs; + + TryToRemove(pkgCacheFile &Cache, pkgProblemResolver *PM) : Cache(&Cache), Fix(PM), + PurgePkgs(_config->FindB("APT::Get::Purge", false)) {}; + + void operator() (pkgCache::VerIterator const &Ver); +}; + /*}}}*/ + + +#endif -- cgit v1.2.3