private-install.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #ifndef APT_PRIVATE_INSTALL_H
  2. #define APT_PRIVATE_INSTALL_H
  3. #include <apt-pkg/cachefile.h>
  4. #include <apt-pkg/configuration.h>
  5. #include <apt-pkg/pkgcache.h>
  6. #include <apt-pkg/cacheiterators.h>
  7. #include <apt-pkg/cacheset.h>
  8. #include <apt-pkg/macros.h>
  9. #include <list>
  10. #include <string>
  11. #include <utility>
  12. class CacheFile;
  13. class CommandLine;
  14. class pkgProblemResolver;
  15. APT_PUBLIC bool DoInstall(CommandLine &Cmd);
  16. bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, std::vector<const char*> &VolatileCmdL, CacheFile &Cache,
  17. std::map<unsigned short, APT::VersionSet> &verset, int UpgradeMode);
  18. bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, std::vector<const char*> &VolatileCmdL, CacheFile &Cache, int UpgradeMode);
  19. bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, CacheFile &Cache, int UpgradeMode);
  20. APT_PUBLIC bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,
  21. bool Safety = true);
  22. bool CheckNothingBroken(CacheFile &Cache);
  23. bool DoAutomaticRemove(CacheFile &Cache);
  24. // TryToInstall - Mark a package for installation /*{{{*/
  25. struct TryToInstall {
  26. pkgCacheFile* Cache;
  27. pkgProblemResolver* Fix;
  28. bool FixBroken;
  29. unsigned long AutoMarkChanged;
  30. APT::PackageSet doAutoInstallLater;
  31. TryToInstall(pkgCacheFile &Cache, pkgProblemResolver *PM, bool const FixBroken) : Cache(&Cache), Fix(PM),
  32. FixBroken(FixBroken), AutoMarkChanged(0) {};
  33. void operator() (pkgCache::VerIterator const &Ver);
  34. bool propergateReleaseCandiateSwitching(std::list<std::pair<pkgCache::VerIterator, std::string> > const &start, std::ostream &out);
  35. void doAutoInstall();
  36. };
  37. /*}}}*/
  38. // TryToRemove - Mark a package for removal /*{{{*/
  39. struct TryToRemove {
  40. pkgCacheFile* Cache;
  41. pkgProblemResolver* Fix;
  42. bool PurgePkgs;
  43. TryToRemove(pkgCacheFile &Cache, pkgProblemResolver *PM) : Cache(&Cache), Fix(PM),
  44. PurgePkgs(_config->FindB("APT::Get::Purge", false)) {};
  45. void operator() (pkgCache::VerIterator const &Ver);
  46. };
  47. /*}}}*/
  48. #endif