summaryrefslogtreecommitdiff
path: root/apt-private/private-install.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2014-08-17 12:30:21 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2014-09-27 00:10:05 +0200
commit2a884c612b10b27f4be2cc6dd689bfe448d9361a (patch)
tree2b5b31e255115ac3b9221a39e852723d6d48438d /apt-private/private-install.cc
parentb13ce62c7e7db6a0e80a0f4729ee00105466c3ac (diff)
fix progress output for (dist-)upgrade calculation
Previously, we had a start and a done of the calculation printed by higher-level code, but this got intermixed by progress reporting from an external solver or the output of autoremove codeā€¦ The higherlevel code is now only responsible for instantiating a progress object of its choosing (if it wants progress after all) and the rest will be handled by the upgrade code. Either it is used to show the progress of the external solver or the internal solver will give some hints about its overall progress. The later isn't really a proper progress as it will jump forward after each substep, but that is at least a bit better than before without any progress indication. Fixes also the 'strange' non-display of this progress line in -q=1, while all others are shown, which is reflected by all testcase changes.
Diffstat (limited to 'apt-private/private-install.cc')
-rw-r--r--apt-private/private-install.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc
index 55893bda0..656b97233 100644
--- a/apt-private/private-install.cc
+++ b/apt-private/private-install.cc
@@ -620,14 +620,17 @@ bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, CacheFile &Cache,
{
// Call the scored problem resolver
bool resolver_fail = false;
+ OpTextProgress Progress(*_config);
+ bool const distUpgradeMode = strcmp(CmdL.FileList[0], "dist-upgrade") == 0 || strcmp(CmdL.FileList[0], "full-upgrade") == 0;
+
if (UpgradeMode == 0)
{
- if (strcmp(CmdL.FileList[0], "dist-upgrade") == 0 || strcmp(CmdL.FileList[0], "full-upgrade") == 0)
- resolver_fail = APT::Upgrade::Upgrade(Cache, 0);
+ if (distUpgradeMode == true)
+ resolver_fail = APT::Upgrade::Upgrade(Cache, 0, &Progress);
else
- resolver_fail = Fix->Resolve(true);
+ resolver_fail = Fix->Resolve(true, &Progress);
} else
- resolver_fail = APT::Upgrade::Upgrade(Cache, UpgradeMode);
+ resolver_fail = APT::Upgrade::Upgrade(Cache, UpgradeMode, &Progress);
if (resolver_fail == false && Cache->BrokenCount() == 0)
return false;