]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/algorithms.h
implement external solver calling for upgrade and dist-upgrade, too
[apt.git] / apt-pkg / algorithms.h
index defaed57d9355aec35834272070f80edcfbfac4c..582cbc527b1c9b4e7d252fae526318319118a0bb 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);
       }
@@ -60,6 +60,7 @@ class pkgSimulate : public pkgPackageManager
    
    Policy iPolicy;
    pkgDepCache Sim;
+   pkgDepCache::ActionGroup group;
    
    // The Actuall installation implementation
    virtual bool Install(PkgIterator Pkg,string File);
@@ -74,8 +75,8 @@ private:
 
    pkgSimulate(pkgDepCache *Cache);
 };
-
-class pkgProblemResolver
+                                                                       /*}}}*/
+class pkgProblemResolver                                               /*{{{*/
 {
    pkgDepCache &Cache;
    typedef pkgCache::PkgIterator PkgIterator;
@@ -104,10 +105,13 @@ class pkgProblemResolver
 
    void MakeScores();
    bool DoUpgrade(pkgCache::PkgIterator Pkg);
+
+   bool ResolveInternal(bool const BrokenFix = false);
+   bool ResolveByKeepInternal();
    
    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);};
    
@@ -123,7 +127,7 @@ class pkgProblemResolver
    pkgProblemResolver(pkgDepCache *Cache);
    ~pkgProblemResolver();
 };
-
+                                                                       /*}}}*/
 bool pkgDistUpgrade(pkgDepCache &Cache);
 bool pkgApplyStatus(pkgDepCache &Cache);
 bool pkgFixBroken(pkgDepCache &Cache);