summaryrefslogtreecommitdiff
path: root/apt-private/private-install.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2013-11-23 09:13:30 +0100
committerMichael Vogt <mvo@debian.org>2013-11-23 09:13:30 +0100
commit7d2428e03c1fdae79488b9ecd53cc5257b2a0c13 (patch)
tree81209b60212c997452fd74cf184b8ca5445e8bc0 /apt-private/private-install.cc
parentf62f17b489405432a3125e51471d8a00e78c5170 (diff)
parent61f954bff040809e7ab57b3adec2fe95339ffb94 (diff)
Merge branch 'debian/sid' into ubuntu/master
Conflicts: debian/changelog
Diffstat (limited to 'apt-private/private-install.cc')
-rw-r--r--apt-private/private-install.cc20
1 files changed, 19 insertions, 1 deletions
diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc
index 643a6b370..3adb00b23 100644
--- a/apt-private/private-install.cc
+++ b/apt-private/private-install.cc
@@ -23,6 +23,8 @@
#include <apt-pkg/pkgsystem.h>
#include <apt-pkg/pkgrecords.h>
#include <apt-pkg/indexfile.h>
+#include <apt-pkg/install-progress.h>
+#include <apt-pkg/init.h>
#include <set>
#include <locale.h>
@@ -103,8 +105,16 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask, bool Safety)
if (_config->FindB("APT::Get::Simulate") == true)
{
pkgSimulate PM(Cache);
+
+#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13)
+ APT::Progress::PackageManager *progress = APT::Progress::PackageManagerProgressFactory();
+ pkgPackageManager::OrderResult Res = PM.DoInstall(progress);
+ delete progress;
+#else
int status_fd = _config->FindI("APT::Status-Fd",-1);
pkgPackageManager::OrderResult Res = PM.DoInstall(status_fd);
+#endif
+
if (Res == pkgPackageManager::Failed)
return false;
if (Res != pkgPackageManager::Completed)
@@ -332,8 +342,16 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask, bool Safety)
}
_system->UnLock();
- int status_fd = _config->FindI("APT::Status-Fd",-1);
+
+#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13)
+ APT::Progress::PackageManager *progress = APT::Progress::PackageManagerProgressFactory();
+ pkgPackageManager::OrderResult Res = PM->DoInstall(progress);
+ delete progress;
+#else
+ int status_fd = _config->FindI("APT::Status-Fd", -1);
pkgPackageManager::OrderResult Res = PM->DoInstall(status_fd);
+#endif
+
if (Res == pkgPackageManager::Failed || _error->PendingError() == true)
return false;
if (Res == pkgPackageManager::Completed)