private-install.h 1.8 KB

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