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.
 
 
 
 
 
 

76 lines
2.9 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> GetAllPackagesAsPseudo(pkgSourceList *const SL, CommandLine &CmdL, bool (*Add)(pkgSourceList *const, PseudoPkg &&, std::vector<PseudoPkg> &), std::string const &pseudoArch);
  25. std::vector<PseudoPkg> GetPseudoPackages(pkgSourceList *const SL, CommandLine &CmdL, bool (*Add)(pkgSourceList *const, PseudoPkg &&, std::vector<PseudoPkg> &), std::string const &pseudoArch);
  26. bool AddVolatileBinaryFile(pkgSourceList *const SL, PseudoPkg &&pkg, std::vector<PseudoPkg> &VolatileCmdL);
  27. bool AddVolatileSourceFile(pkgSourceList *const SL, PseudoPkg &&pkg, std::vector<PseudoPkg> &VolatileCmdL);
  28. bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, std::vector<PseudoPkg> &VolatileCmdL, CacheFile &Cache,
  29. std::map<unsigned short, APT::VersionSet> &verset, int UpgradeMode, std::set<std::string> &UnknownPackages);
  30. bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, std::vector<PseudoPkg> &VolatileCmdL, CacheFile &Cache, int UpgradeMode);
  31. bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, CacheFile &Cache, int UpgradeMode);
  32. APT_PUBLIC bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,
  33. bool Safety = true);
  34. bool CheckNothingBroken(CacheFile &Cache);
  35. bool DoAutomaticRemove(CacheFile &Cache);
  36. // TryToInstall - Mark a package for installation /*{{{*/
  37. struct TryToInstall {
  38. pkgCacheFile* Cache;
  39. pkgProblemResolver* Fix;
  40. bool FixBroken;
  41. unsigned long AutoMarkChanged;
  42. APT::PackageSet doAutoInstallLater;
  43. TryToInstall(pkgCacheFile &Cache, pkgProblemResolver *PM, bool const FixBroken) : Cache(&Cache), Fix(PM),
  44. FixBroken(FixBroken), AutoMarkChanged(0) {};
  45. void operator() (pkgCache::VerIterator const &Ver);
  46. bool propergateReleaseCandiateSwitching(std::list<std::pair<pkgCache::VerIterator, std::string> > const &start, std::ostream &out);
  47. void doAutoInstall();
  48. };
  49. /*}}}*/
  50. // TryToRemove - Mark a package for removal /*{{{*/
  51. struct TryToRemove {
  52. pkgCacheFile* Cache;
  53. pkgProblemResolver* Fix;
  54. bool PurgePkgs;
  55. TryToRemove(pkgCacheFile &Cache, pkgProblemResolver *PM) : Cache(&Cache), Fix(PM),
  56. PurgePkgs(_config->FindB("APT::Get::Purge", false)) {};
  57. void operator() (pkgCache::VerIterator const &Ver);
  58. };
  59. /*}}}*/
  60. #endif