You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

75 lines
2.8 KiB

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