]> git.saurik.com Git - apt.git/commitdiff
restore binary compatiblity with the pkgPackageManager interface
authorMichael Vogt <mvo@debian.org>
Mon, 21 Oct 2013 19:42:16 +0000 (21:42 +0200)
committerMichael Vogt <mvo@debian.org>
Mon, 21 Oct 2013 20:11:18 +0000 (22:11 +0200)
apt-pkg/deb/dpkgpm.cc
apt-pkg/packagemanager.cc
apt-pkg/packagemanager.h
test/integration/test-apt-progress-fd-deb822 [new file with mode: 0644]

index a61f08d911b6a3cff0f499c6c4511315de6f46ee..adc94f05cc24ab78511095320f286ad8dc1ead84 100644 (file)
@@ -19,7 +19,8 @@
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/cachefile.h>
 #include <apt-pkg/packagemanager.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/cachefile.h>
 #include <apt-pkg/packagemanager.h>
-#include <apt-pkg/iprogress.h>
+
+#include <apt-private/private-progress.h>
 
 #include <unistd.h>
 #include <stdlib.h>
 
 #include <unistd.h>
 #include <stdlib.h>
index 3690a64c35a2b431f375d498afed3e8097c9b001..a2079a2e4554d76429a8765612cb2c690eae4dae 100644 (file)
@@ -1027,6 +1027,18 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
         
    return Completed;
 }
         
    return Completed;
 }
+// PM::DoInstallPostFork - compat /*{{{*/
+// ---------------------------------------------------------------------
+                                                                       /*}}}*/
+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 /*{{{*/
 // ---------------------------------------------------------------------
                                                                        /*}}}*/
 // PM::DoInstallPostFork - Does install part that happens after the fork /*{{{*/
 // ---------------------------------------------------------------------
@@ -1042,6 +1054,19 @@ pkgPackageManager::DoInstallPostFork(APT::Progress::PackageManager *progress)
                                                                        /*}}}*/ 
 // PM::DoInstall - Does the installation                               /*{{{*/
 // ---------------------------------------------------------------------
                                                                        /*}}}*/ 
 // PM::DoInstall - Does the installation                               /*{{{*/
 // ---------------------------------------------------------------------
+/* compat */
+pkgPackageManager::OrderResult 
+pkgPackageManager::DoInstall(int statusFd)
+{
+    APT::Progress::PackageManager *progress = new
+       APT::Progress::PackageManagerProgressFd(statusFd);
+    OrderResult res = DoInstall(progress);
+    delete progress;
+    return res;
+ }
+                                                                       /*}}}*/ 
+// PM::DoInstall - Does the installation                               /*{{{*/
+// ---------------------------------------------------------------------
 /* This uses the filenames in FileNames and the information in the
    DepCache to perform the installation of packages.*/
 pkgPackageManager::OrderResult 
 /* This uses the filenames in FileNames and the information in the
    DepCache to perform the installation of packages.*/
 pkgPackageManager::OrderResult 
index 5c15ac0e43c67257432b080ab44509d7abe8de78..dcd12f97980777b1cba40a59a9938c9a97aa222e 100644 (file)
 #ifndef PKGLIB_PACKAGEMANAGER_H
 #define PKGLIB_PACKAGEMANAGER_H
 
 #ifndef PKGLIB_PACKAGEMANAGER_H
 #define PKGLIB_PACKAGEMANAGER_H
 
+#include <apt-pkg/macros.h>
 #include <apt-pkg/pkgcache.h>
 #include <apt-pkg/pkgcache.h>
-#include <apt-pkg/iprogress.h>
+
+#include <apt-private/private-progress.h>
 
 #include <string>
 #include <iostream>
 
 #include <string>
 #include <iostream>
@@ -100,16 +102,8 @@ class pkgPackageManager : protected pkgCache::Namespace
 
    // Do the installation 
    OrderResult DoInstall(APT::Progress::PackageManager *progress);
 
    // Do the installation 
    OrderResult DoInstall(APT::Progress::PackageManager *progress);
-
    // compat
    // compat
-   OrderResult DoInstall(int statusFd=-1) {
-      APT::Progress::PackageManager *progress = new
-         APT::Progress::PackageManagerProgressFd(statusFd);
-      OrderResult res = DoInstall(progress);
-      delete progress;
-      return res;
-   }
-
+   __deprecated OrderResult DoInstall(int statusFd=-1);
 
    // stuff that needs to be done before the fork() of a library that
    // uses apt
 
    // stuff that needs to be done before the fork() of a library that
    // uses apt
@@ -120,6 +114,10 @@ class pkgPackageManager : protected pkgCache::Namespace
 
    // stuff that needs to be done after the fork
    OrderResult DoInstallPostFork(APT::Progress::PackageManager *progress);
 
    // stuff that needs to be done after the fork
    OrderResult DoInstallPostFork(APT::Progress::PackageManager *progress);
+   // compat
+   __deprecated OrderResult DoInstallPostFork(int statusFd=-1);
+
+   // ?
    bool FixMissing();
 
    /** \brief returns all packages dpkg let disappear */
    bool FixMissing();
 
    /** \brief returns all packages dpkg let disappear */
diff --git a/test/integration/test-apt-progress-fd-deb822 b/test/integration/test-apt-progress-fd-deb822
new file mode 100644 (file)
index 0000000..0a7be0c
--- /dev/null
@@ -0,0 +1,54 @@
+
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture 'amd64' 'i386'
+
+buildsimplenativepackage 'testing' 'amd64' '0.1' 'stable'
+buildsimplenativepackage 'testing' 'all' '0.8.15' 'stable'
+buildsimplenativepackage 'testing2' 'amd64,i386' '0.8.15' 'stable'
+setupaptarchive 
+
+# install native
+exec 3> apt-progress.log
+testsuccess aptget install testing=0.1 -y -o APT::Status-deb822-Fd=3
+testequal "# and compare
+testequal "percent:0
+message: Running dpkg
+
+package: testing2
+percent: 0
+message: Installing testing2 (i386)
+
+package: testing2
+percent: 20
+message: Preparing testing2 (i386)
+
+package: testing2
+percent: 40
+message: Unpacking testing2 (i386)
+
+package: testing2
+percent: 60
+message: Preparing to configure testing2 (i386)
+
+percent: 60
+message: Running dpkg
+
+package: testing2
+percent: 60
+message: Configuring testing2 (i386)
+
+package: testing2
+percent: 80
+message: Configuring testing2 (i386)
+
+package: testing2
+percent: 100
+message: Installed testing2 (i386)" cat apt-progress.log
+
+
+rm -f apt-progress*.log