]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/algorithms.h
fix progress output for (dist-)upgrade calculation
[apt.git] / apt-pkg / algorithms.h
index 37eacf1f8d77b94b7fbcdb8ef8ecf1c53c73ba03..4d3bfa81fe02086fef948714c387e88caba5f358 100644 (file)
@@ -10,7 +10,7 @@
    see all of the effects of an upgrade run.
 
    pkgDistUpgrade computes an upgrade that causes as many packages as
-   possible to move to the newest verison.
+   possible to move to the newest version.
    
    pkgApplyStatus sets the target state based on the content of the status
    field in the status file. It is important to get proper crash recovery.
 
 #include <apt-pkg/packagemanager.h>
 #include <apt-pkg/depcache.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
 
 #include <iostream>
+#include <string>
+
+#include <apt-pkg/macros.h>
 
 #ifndef APT_8_CLEANER_HEADERS
 #include <apt-pkg/acquire.h>
 using std::ostream;
 #endif
 
-class pkgAcquireStatus;
+#ifndef APT_9_CLEANER_HEADERS
+// include pkg{DistUpgrade,AllUpgrade,MiniizeUpgrade} here for compatibility
+#include <apt-pkg/upgrade.h>
+#include <apt-pkg/update.h>
+#endif
+
 
 class pkgSimulate : public pkgPackageManager                           /*{{{*/
 {
@@ -78,10 +88,12 @@ private:
    public:
 
    pkgSimulate(pkgDepCache *Cache);
+   ~pkgSimulate();
 };
                                                                        /*}}}*/
 class pkgProblemResolver                                               /*{{{*/
 {
+ private:
    /** \brief dpointer placeholder (for later in case we need it) */
    void *d;
 
@@ -102,7 +114,7 @@ class pkgProblemResolver                                            /*{{{*/
    
    // Sort stuff
    static pkgProblemResolver *This;
-   static int ScoreSort(const void *a,const void *b);
+   static int ScoreSort(const void *a,const void *b) APT_PURE;
 
    struct PackageKill
    {
@@ -124,28 +136,23 @@ class pkgProblemResolver                                          /*{{{*/
    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);};
-   
-   // Try to intelligently resolve problems by installing and removing packages   
-   bool Resolve(bool BrokenFix = false);
-   
+
+   // Try to intelligently resolve problems by installing and removing packages
+   bool Resolve(bool BrokenFix = false, OpProgress * const Progress = NULL);
+
    // Try to resolve problems only by using keep
-   bool ResolveByKeep();
+   bool ResolveByKeep(OpProgress * const Progress = NULL);
+
+   APT_DEPRECATED void InstallProtect();
 
-   // Install all protected packages   
-   void InstallProtect();   
-   
    pkgProblemResolver(pkgDepCache *Cache);
    ~pkgProblemResolver();
 };
                                                                        /*}}}*/
-bool pkgDistUpgrade(pkgDepCache &Cache);
 bool pkgApplyStatus(pkgDepCache &Cache);
 bool pkgFixBroken(pkgDepCache &Cache);
-bool pkgAllUpgrade(pkgDepCache &Cache);
-bool pkgMinimizeUpgrade(pkgDepCache &Cache);
 
 void pkgPrioSortList(pkgCache &Cache,pkgCache::Version **List);
 
-bool ListUpdate(pkgAcquireStatus &progress, pkgSourceList &List, int PulseInterval=0);
-                    
+
 #endif