private-install.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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, CacheFile &Cache,
  17. std::map<unsigned short, APT::VersionSet> &verset, int UpgradeMode);
  18. bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, CacheFile &Cache, int UpgradeMode);
  19. APT_PUBLIC bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,
  20. bool Safety = true);
  21. // TryToInstall - Mark a package for installation /*{{{*/
  22. struct APT_PUBLIC TryToInstall {
  23. pkgCacheFile* Cache;
  24. pkgProblemResolver* Fix;
  25. bool FixBroken;
  26. unsigned long AutoMarkChanged;
  27. APT::PackageSet doAutoInstallLater;
  28. TryToInstall(pkgCacheFile &Cache, pkgProblemResolver *PM, bool const FixBroken) : Cache(&Cache), Fix(PM),
  29. FixBroken(FixBroken), AutoMarkChanged(0) {};
  30. void operator() (pkgCache::VerIterator const &Ver);
  31. bool propergateReleaseCandiateSwitching(std::list<std::pair<pkgCache::VerIterator, std::string> > const &start, std::ostream &out);
  32. void doAutoInstall();
  33. };
  34. /*}}}*/
  35. // TryToRemove - Mark a package for removal /*{{{*/
  36. struct APT_PUBLIC TryToRemove {
  37. pkgCacheFile* Cache;
  38. pkgProblemResolver* Fix;
  39. bool PurgePkgs;
  40. TryToRemove(pkgCacheFile &Cache, pkgProblemResolver *PM) : Cache(&Cache), Fix(PM),
  41. PurgePkgs(_config->FindB("APT::Get::Purge", false)) {};
  42. void operator() (pkgCache::VerIterator const &Ver);
  43. };
  44. /*}}}*/
  45. #endif