Dont try to configure packages using SmartConfigure when not performing immediate...
[ntk/apt.git] / apt-pkg / packagemanager.h
index 48f5357..d4a25e9 100644 (file)
 #ifndef PKGLIB_PACKAGEMANAGER_H
 #define PKGLIB_PACKAGEMANAGER_H
 
-#ifdef __GNUG__
-#pragma interface "apt-pkg/packagemanager.h"
-#endif
 
 #include <string>
 #include <iostream>
 #include <apt-pkg/pkgcache.h>
 #include <apt-pkg/depcache.h>
+#include <set>
 
 using std::string;
 
@@ -50,8 +48,19 @@ class pkgPackageManager : protected pkgCache::Namespace
    pkgDepCache &Cache;
    pkgOrderList *List;
    bool Debug;
-         
+   bool NoImmConfigure;
+   bool ImmConfigureAll;
+
+   /** \brief saves packages dpkg let disappear
+
+       This way APT can retreat from trying to configure these
+       packages later on and a frontend can choose to display a
+       notice to inform the user about these disappears.
+   */
+   std::set<std::string> disappearedPkgs;
+
    bool DepAdd(pkgOrderList &Order,PkgIterator P,int Depth = 0);
+   void ImmediateAdd(PkgIterator P, bool UseInstallVer, unsigned const int &Depth = 0);
    virtual OrderResult OrderInstall();
    bool CheckRConflicts(PkgIterator Pkg,DepIterator Dep,const char *Ver);
    bool CreateOrderList();
@@ -62,9 +71,13 @@ class pkgPackageManager : protected pkgCache::Namespace
    // Install helpers
    bool ConfigureAll();
    bool SmartConfigure(PkgIterator Pkg);
+   //FIXME: merge on abi break
    bool SmartUnPack(PkgIterator Pkg);
+   bool SmartUnPack(PkgIterator Pkg, bool const Immediate);
    bool SmartRemove(PkgIterator Pkg);
-   bool EarlyRemove(PkgIterator Pkg);   
+   bool EarlyRemove(PkgIterator Pkg);  
+   bool VerifyAndConfigure(PkgIterator Pkg, pkgOrderList &OList);
+   bool VerifyConfigure(PkgIterator Pkg, pkgOrderList &OList); 
    
    // The Actual installation implementation
    virtual bool Install(PkgIterator /*Pkg*/,string /*File*/) {return false;};
@@ -93,20 +106,12 @@ class pkgPackageManager : protected pkgCache::Namespace
    };
 
    // stuff that needs to be done after the fork
-   OrderResult DoInstallPostFork(int statusFd=-1) {
-      bool goResult = Go(statusFd);
-      if(goResult == false) 
-        return Failed;
-
-      // if all was fine update the state file
-      if(Res == Completed) {
-        Cache.writeStateFile(NULL);
-      }
-      return Res;
-   };
-
+   OrderResult DoInstallPostFork(int statusFd=-1);
    bool FixMissing();
-   
+
+   /** \brief returns all packages dpkg let disappear */
+   inline std::set<std::string> GetDisappearedPackages() { return disappearedPkgs; };
+
    pkgPackageManager(pkgDepCache *Cache);
    virtual ~pkgPackageManager();
 };