X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/61d6a8de486f2262acbb47cea24f5dae143be8d1..e75f306ea9596c82e3b0c188e9b5203fc9d619da:/apt-pkg/algorithms.h diff --git a/apt-pkg/algorithms.h b/apt-pkg/algorithms.h index d68fbfbea..174a7f58d 100644 --- a/apt-pkg/algorithms.h +++ b/apt-pkg/algorithms.h @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: algorithms.h,v 1.8 1999/10/27 04:38:27 jgg Exp $ +// $Id: algorithms.h,v 1.10 2001/05/22 04:17:41 jgg Exp $ /* ###################################################################### Algorithms - A set of misc algorithms @@ -27,7 +27,6 @@ ##################################################################### */ /*}}}*/ -// Header section: pkglib #ifndef PKGLIB_ALGORITHMS_H #define PKGLIB_ALGORITHMS_H @@ -38,23 +37,44 @@ #include #include +#include + +using std::ostream; + class pkgSimulate : public pkgPackageManager { protected: + class Policy : public pkgDepCache::Policy + { + pkgDepCache *Cache; + public: + + virtual VerIterator GetCandidateVer(PkgIterator Pkg) + { + return (*Cache)[Pkg].CandidateVerIter(*Cache); + } + + Policy(pkgDepCache *Cache) : Cache(Cache) {}; + }; + unsigned char *Flags; + Policy iPolicy; pkgDepCache Sim; // The Actuall installation implementation virtual bool Install(PkgIterator Pkg,string File); virtual bool Configure(PkgIterator Pkg); virtual bool Remove(PkgIterator Pkg,bool Purge); + +private: void ShortBreaks(); + void Describe(PkgIterator iPkg,ostream &out,bool Current,bool Candidate); public: - pkgSimulate(pkgDepCache &Cache); + pkgSimulate(pkgDepCache *Cache); }; class pkgProblemResolver @@ -101,7 +121,8 @@ class pkgProblemResolver void InstallProtect(); - pkgProblemResolver(pkgDepCache &Cache); + pkgProblemResolver(pkgDepCache *Cache); + ~pkgProblemResolver(); }; bool pkgDistUpgrade(pkgDepCache &Cache); @@ -110,4 +131,6 @@ bool pkgFixBroken(pkgDepCache &Cache); bool pkgAllUpgrade(pkgDepCache &Cache); bool pkgMinimizeUpgrade(pkgDepCache &Cache); +void pkgPrioSortList(pkgCache &Cache,pkgCache::Version **List); + #endif