Browse Source

don't show update stats if cache generation is disabled

Unlikely that anyone is actually running into this, but if we asked to
not generate a cache and avoid it in the first step we shouldn't create
one implicitly anyway by displaying the statistics.
tags/debian/1.4_rc1
David Kalnischkies 4 years ago
parent
commit
33f982b90a
2 changed files with 7 additions and 6 deletions
  1. +6
    -6
      apt-private/private-update.cc
  2. +1
    -0
      test/integration/test-apt-cli-update

+ 6
- 6
apt-private/private-update.cc View File

@@ -71,13 +71,13 @@ bool DoUpdate(CommandLine &CmdL)
ListUpdate(Stat, *List);
}

if (_config->FindB("pkgCacheFile::Generate", true) == false)
return true;

// Rebuild the cache.
if (_config->FindB("pkgCacheFile::Generate", true) == true)
{
pkgCacheFile::RemoveCaches();
if (Cache.BuildCaches() == false)
return false;
}
pkgCacheFile::RemoveCaches();
if (Cache.BuildCaches() == false)
return false;

// show basic stats (if the user whishes)
if (_config->FindB("APT::Cmd::Show-Update-Stats", false) == true)


+ 1
- 0
test/integration/test-apt-cli-update View File

@@ -15,6 +15,7 @@ setupaptarchive --no-update

testfailuremsg 'E: The update command takes no arguments' apt update arguments

testempty apt update -qq -o pkgCacheFile::Generate=false
testsuccessequal "1 package can be upgraded. Run 'apt list --upgradable' to see it." apt update -qq

cp dpkg.status rootdir/var/lib/dpkg/status


Loading…
Cancel
Save