]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/algorithms.h
merged from lp:~donkult/apt/sid
[apt.git] / apt-pkg / algorithms.h
index d183cd21303bde0e77a6935d85cf8113d14d7968..99501bed1e5dcb945b2b265607069478bc439c12 100644 (file)
@@ -39,7 +39,7 @@
 
 using std::ostream;
 
-class pkgSimulate : public pkgPackageManager
+class pkgSimulate : public pkgPackageManager                           /*{{{*/
 {
    protected:
 
@@ -48,7 +48,7 @@ class pkgSimulate : public pkgPackageManager
       pkgDepCache *Cache;
       public:
       
-      virtual VerIterator GetCandidateVer(PkgIterator Pkg)
+      virtual VerIterator GetCandidateVer(PkgIterator const &Pkg)
       {
         return (*Cache)[Pkg].CandidateVerIter(*Cache);
       }
@@ -75,8 +75,8 @@ private:
 
    pkgSimulate(pkgDepCache *Cache);
 };
-
-class pkgProblemResolver
+                                                                       /*}}}*/
+class pkgProblemResolver                                               /*{{{*/
 {
    pkgDepCache &Cache;
    typedef pkgCache::PkgIterator PkgIterator;
@@ -106,9 +106,12 @@ class pkgProblemResolver
    void MakeScores();
    bool DoUpgrade(pkgCache::PkgIterator Pkg);
    
+   protected:
+   bool InstOrNewPolicyBroken(pkgCache::PkgIterator Pkg);
+
    public:
    
-   inline void Protect(pkgCache::PkgIterator Pkg) {Flags[Pkg->ID] |= Protected;};
+   inline void Protect(pkgCache::PkgIterator Pkg) {Flags[Pkg->ID] |= Protected; Cache.MarkProtected(Pkg);};
    inline void Remove(pkgCache::PkgIterator Pkg) {Flags[Pkg->ID] |= ToRemove;};
    inline void Clear(pkgCache::PkgIterator Pkg) {Flags[Pkg->ID] &= ~(Protected | ToRemove);};
    
@@ -124,7 +127,7 @@ class pkgProblemResolver
    pkgProblemResolver(pkgDepCache *Cache);
    ~pkgProblemResolver();
 };
-
+                                                                       /*}}}*/
 bool pkgDistUpgrade(pkgDepCache &Cache);
 bool pkgApplyStatus(pkgDepCache &Cache);
 bool pkgFixBroken(pkgDepCache &Cache);