summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2024-04-03 12:36:40 +0000
committerDavid Kalnischkies <david@kalnischkies.de>2024-04-24 13:16:21 +0000
commit7d93bcabc3f2c47c093faae7b36b7709f287cce2 (patch)
tree5c6764d88b41b83e06ffedfdbc108c00a225e4a2
parent3e24f431d9527816820e103df7db9f39062b551d (diff)
Avoid figuring which kept pkgs are phased if we don't display it
Not all commands show kept back packages, so even if it hardly matters, lets not crunch numbers needlessly if we don't need the info which also reduces the lifetime of the involved variables hopefully also reducing the mental requirements for a reader.
-rw-r--r--apt-private/private-install.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc
index 9a2ed0b2a..8d1bc74f0 100644
--- a/apt-private/private-install.cc
+++ b/apt-private/private-install.cc
@@ -214,16 +214,6 @@ bool InstallPackages(CacheFile &Cache, APT::PackageVector &HeldBackPackages, boo
return false;
}
- APT::PackageVector PhasingPackages;
- APT::PackageVector NotPhasingHeldBackPackages;
- for (auto const &Pkg : HeldBackPackages)
- {
- if (Cache->PhasingApplied(Pkg))
- PhasingPackages.push_back(Pkg);
- else
- NotPhasingHeldBackPackages.push_back(Pkg);
- }
-
// Show all the various warning indicators
if (_config->FindI("APT::Output-Version") < 30)
ShowDel(c1out,Cache);
@@ -234,6 +224,16 @@ bool InstallPackages(CacheFile &Cache, APT::PackageVector &HeldBackPackages, boo
ShowWeakDependencies(Cache);
if (ShwKept == true)
{
+ APT::PackageVector PhasingPackages;
+ APT::PackageVector NotPhasingHeldBackPackages;
+ for (auto const &Pkg : HeldBackPackages)
+ {
+ if (Cache->PhasingApplied(Pkg))
+ PhasingPackages.push_back(Pkg);
+ else
+ NotPhasingHeldBackPackages.push_back(Pkg);
+ }
+
ShowPhasing(c1out, Cache, PhasingPackages);
ShowKept(c1out, Cache, NotPhasingHeldBackPackages);
if (not PhasingPackages.empty() && not NotPhasingHeldBackPackages.empty())