]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/packagemanager.cc
fix some more ABI issues, abicheck is happy now
[apt.git] / apt-pkg / packagemanager.cc
index 32bc5284ef730f51c878ffca408a99cff174c19e..3fdd9b6375e570997f42f27157efbe83f3d895b9 100644 (file)
@@ -26,7 +26,6 @@
 #include <apt-pkg/sptr.h>
 
 #include <iostream>
-#include <fcntl.h>
 
 #include <apti18n.h>
                                                                        /*}}}*/
@@ -1027,6 +1026,19 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
    }
         
    return Completed;
+}
+// PM::DoInstallPostFork - compat /*{{{*/
+// ---------------------------------------------------------------------
+                                                                       /*}}}*/
+#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13)
+pkgPackageManager::OrderResult
+pkgPackageManager::DoInstallPostFork(int statusFd)
+{
+   APT::Progress::PackageManager *progress = new
+      APT::Progress::PackageManagerProgressFd(statusFd);
+   pkgPackageManager::OrderResult res = DoInstallPostFork(progress);
+   delete progress;
+   return res;
 }
                                                                        /*}}}*/
 // PM::DoInstallPostFork - Does install part that happens after the fork /*{{{*/
@@ -1034,24 +1046,52 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
 pkgPackageManager::OrderResult 
 pkgPackageManager::DoInstallPostFork(APT::Progress::PackageManager *progress)
 {
-// FIXME: port to new structure
-#if 0
-      if(statusFd > 0)
-         // FIXME: use SetCloseExec here once it taught about throwing
-        //        exceptions instead of doing _exit(100) on failure
-        fcntl(statusFd,F_SETFD,FD_CLOEXEC); 
+   bool goResult = Go(progress);
+   if(goResult == false) 
+      return Failed;
+   
+   return Res;
+};
+#else
+pkgPackageManager::OrderResult
+pkgPackageManager::DoInstallPostFork(int statusFd)
+{
+   bool goResult = Go(statusFd);
+   if(goResult == false) 
+      return Failed;
+   
+   return Res;
+}
 #endif
-      bool goResult = Go(progress);
-      if(goResult == false) 
-        return Failed;
+                                                                       /*}}}*/ 
+// PM::DoInstall - Does the installation                               /*{{{*/
+// ---------------------------------------------------------------------
+/* compat */
+#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13)
+pkgPackageManager::OrderResult 
+pkgPackageManager::DoInstall(int statusFd)
+{
+    APT::Progress::PackageManager *progress = new
+       APT::Progress::PackageManagerProgressFd(statusFd);
+    OrderResult res = DoInstall(progress);
+    delete progress;
+    return res;
+ }
+#else
+pkgPackageManager::OrderResult pkgPackageManager::DoInstall(int statusFd)
+{
+   if(DoInstallPreFork() == Failed)
+      return Failed;
 
-      return Res;
-};
+   return DoInstallPostFork(statusFd);
+}
+#endif
                                                                        /*}}}*/ 
 // PM::DoInstall - Does the installation                               /*{{{*/
 // ---------------------------------------------------------------------
 /* This uses the filenames in FileNames and the information in the
    DepCache to perform the installation of packages.*/
+#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13)
 pkgPackageManager::OrderResult 
 pkgPackageManager::DoInstall(APT::Progress::PackageManager *progress)
 {
@@ -1060,4 +1100,5 @@ pkgPackageManager::DoInstall(APT::Progress::PackageManager *progress)
    
    return DoInstallPostFork(progress);
 }
+#endif
                                                                        /*}}}*/