summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2024-02-13 12:54:07 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2024-02-13 15:08:57 +0100
commit1a0882558da05eaf471c2b4049ae27305e7c70ec (patch)
treefe7dfd0ab95faafa015de14cd7e3de948e53f853
parent82f4cfc971ef6a2e56b34227d9e0b1a594dc2265 (diff)
Show a separate list of upgrades deferred due to phasing
This introduces a new line: The following upgrades have been deferred due to phasing This is any kept back package that is also phasing. This may not be 100% accurate as we have kept it back due to other reasons in an install command, for example, but we don't track for which packages we applied phasing in reality. If additional packages are kept back that are not phasing, show a a notice "N: Some packages may have been kept back due to phasing." LP: #1988819
-rw-r--r--apt-private/private-install.cc17
-rw-r--r--apt-private/private-output.cc10
-rw-r--r--apt-private/private-output.h1
-rwxr-xr-xtest/integration/test-phased-updates-new-depends6
-rwxr-xr-xtest/integration/test-phased-updates-upgrade42
-rwxr-xr-xtest/integration/test-ubuntu-bug-2025462-phased-dist-upgrade4
6 files changed, 68 insertions, 12 deletions
diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc
index 2f254ca27..dbcba8fd1 100644
--- a/apt-private/private-install.cc
+++ b/apt-private/private-install.cc
@@ -210,11 +210,26 @@ 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
ShowDel(c1out,Cache);
ShowNew(c1out,Cache);
if (ShwKept == true)
- ShowKept(c1out,Cache, HeldBackPackages);
+ {
+ ShowPhasing(c1out, Cache, PhasingPackages);
+ ShowKept(c1out, Cache, NotPhasingHeldBackPackages);
+ if (not PhasingPackages.empty() && not NotPhasingHeldBackPackages.empty())
+ _error->Notice("Some packages may have been kept back due to phasing.");
+ }
bool const Hold = not ShowHold(c1out,Cache);
if (_config->FindB("APT::Get::Show-Upgraded",true) == true)
ShowUpgraded(c1out,Cache);
diff --git a/apt-private/private-output.cc b/apt-private/private-output.cc
index 03fbe47e1..c73d5229b 100644
--- a/apt-private/private-output.cc
+++ b/apt-private/private-output.cc
@@ -490,6 +490,16 @@ void ShowDel(ostream &out,CacheFile &Cache)
CandidateVersion(&Cache));
}
/*}}}*/
+// ShowPhasing - Show packages kept due to phasing /*{{{*/
+void ShowPhasing(ostream &out, CacheFile &Cache, APT::PackageVector const &HeldBackPackages)
+{
+ SortedPackageUniverse Universe(Cache);
+ ShowList(out, _("The following upgrades have been deferred due to phasing:"), HeldBackPackages,
+ &AlwaysTrue,
+ &PrettyFullName,
+ CurrentToCandidateVersion(&Cache));
+}
+ /*}}}*/
// ShowKept - Show kept packages /*{{{*/
void ShowKept(ostream &out,CacheFile &Cache, APT::PackageVector const &HeldBackPackages)
{
diff --git a/apt-private/private-output.h b/apt-private/private-output.h
index d6f25e1ec..c3e73d592 100644
--- a/apt-private/private-output.h
+++ b/apt-private/private-output.h
@@ -93,6 +93,7 @@ template<class Container, class PredicateC, class DisplayP, class DisplayV> bool
void ShowNew(std::ostream &out,CacheFile &Cache);
void ShowDel(std::ostream &out,CacheFile &Cache);
void ShowKept(std::ostream &out,CacheFile &Cache, APT::PackageVector const &HeldBackPackages);
+void ShowPhasing(std::ostream &out, CacheFile &Cache, APT::PackageVector const &HeldBackPackages);
void ShowUpgraded(std::ostream &out,CacheFile &Cache);
bool ShowDowngraded(std::ostream &out,CacheFile &Cache);
bool ShowHold(std::ostream &out,CacheFile &Cache);
diff --git a/test/integration/test-phased-updates-new-depends b/test/integration/test-phased-updates-new-depends
index 8cc9314ad..5d6ac80d8 100755
--- a/test/integration/test-phased-updates-new-depends
+++ b/test/integration/test-phased-updates-new-depends
@@ -35,7 +35,7 @@ The following packages have been kept back:
testsuccessequal "Reading package lists...
Building dependency tree...
Calculating upgrade...
-The following packages have been kept back:
+The following upgrades have been deferred due to phasing:
has-new-conflicts has-new-depends has-new-recommends
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded." aptget upgrade -s -q
@@ -62,7 +62,7 @@ Conf new-recommends (2 unstable-updates [all])" aptget upgrade -s -q --with-new-
testsuccessequal "Reading package lists...
Building dependency tree...
Calculating upgrade...
-The following packages have been kept back:
+The following upgrades have been deferred due to phasing:
has-new-conflicts has-new-depends has-new-recommends
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded." aptget upgrade -s -q --with-new-pkgs
@@ -91,6 +91,6 @@ Conf new-recommends (2 unstable-updates [all])" aptget dist-upgrade -s -q -o APT
testsuccessequal "Reading package lists...
Building dependency tree...
Calculating upgrade...
-The following packages have been kept back:
+The following upgrades have been deferred due to phasing:
has-new-conflicts has-new-depends has-new-recommends
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded." aptget dist-upgrade -s -q
diff --git a/test/integration/test-phased-updates-upgrade b/test/integration/test-phased-updates-upgrade
index 3bee1dc86..4f415f22e 100755
--- a/test/integration/test-phased-updates-upgrade
+++ b/test/integration/test-phased-updates-upgrade
@@ -53,8 +53,10 @@ Building dependency tree...
Calculating upgrade...
The following NEW packages will be installed:
phased-new
+The following upgrades have been deferred due to phasing:
+ phased phased-dep phased-depends-ready-dep
The following packages have been kept back:
- depends-phased-dep phased phased-dep phased-depends-ready-dep ready-dep
+ depends-phased-dep ready-dep
The following packages will be upgraded:
depends-phased-new phased-security phased-security-same
3 upgraded, 1 newly installed, 0 to remove and 5 not upgraded.
@@ -67,6 +69,23 @@ Conf depends-phased-new (3 unstable-updates [all])
Conf phased-security (3 unstable-updates [all])
Conf phased-security-same (3 unstable-security, unstable-updates [all])" aptget dist-upgrade -s -q
+testequal "Reading package lists...
+Building dependency tree...
+Calculating upgrade...
+The following NEW packages will be installed:
+ phased-new
+The following upgrades have been deferred due to phasing:
+ phased phased-dep phased-depends-ready-dep
+The following packages have been kept back:
+ depends-phased-dep ready-dep
+The following packages will be upgraded:
+ depends-phased-new phased-security phased-security-same
+3 upgraded, 1 newly installed, 0 to remove and 5 not upgraded.
+Need to get 0 B/168 B of archives.
+After this operation, 43.0 kB of additional disk space will be used.
+N: Some packages may have been kept back due to phasing.
+Do you want to continue? [Y/n] Abort." apt dist-upgrade < /dev/null
+
testsuccessequal "Listing...
phased-dep/unstable-updates 3 all [upgradable from: 1]
phased-depends-ready-dep/unstable-updates 3 all [upgradable from: 1]
@@ -140,8 +159,10 @@ Building dependency tree...
Calculating upgrade...
The following NEW packages will be installed:
phased-new
+The following upgrades have been deferred due to phasing:
+ phased phased-dep phased-depends-ready-dep
The following packages have been kept back:
- depends-phased-dep phased phased-dep phased-depends-ready-dep ready-dep
+ depends-phased-dep ready-dep
The following packages will be upgraded:
depends-phased-new phased-security phased-security-same
3 upgraded, 1 newly installed, 0 to remove and 5 not upgraded.
@@ -160,8 +181,10 @@ Building dependency tree...
Calculating upgrade...
The following NEW packages will be installed:
phased-new
+The following upgrades have been deferred due to phasing:
+ phased phased-dep phased-depends-ready-dep
The following packages have been kept back:
- depends-phased-dep phased phased-dep phased-depends-ready-dep ready-dep
+ depends-phased-dep ready-dep
The following packages will be upgraded:
depends-phased-new phased-security phased-security-same
3 upgraded, 1 newly installed, 0 to remove and 5 not upgraded.
@@ -177,9 +200,10 @@ Conf phased-security-same (3 unstable-security, unstable-updates [all])" aptget
testsuccessequal "Reading package lists...
Building dependency tree...
Calculating upgrade...
+The following upgrades have been deferred due to phasing:
+ phased phased-dep phased-depends-ready-dep
The following packages have been kept back:
- depends-phased-dep depends-phased-new phased phased-dep
- phased-depends-ready-dep ready-dep
+ depends-phased-dep depends-phased-new ready-dep
The following packages will be upgraded:
phased-security phased-security-same
2 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
@@ -194,8 +218,10 @@ Building dependency tree...
Calculating upgrade...
The following NEW packages will be installed:
phased-new
+The following upgrades have been deferred due to phasing:
+ phased phased-depends-ready-dep
The following packages have been kept back:
- phased phased-depends-ready-dep ready-dep
+ ready-dep
The following packages will be upgraded:
depends-phased-dep depends-phased-new phased-dep phased-security
phased-security-same
@@ -217,8 +243,10 @@ done
testsuccessequal "Reading package lists...
Building dependency tree...
Calculating upgrade...
+The following upgrades have been deferred due to phasing:
+ phased phased-depends-ready-dep
The following packages have been kept back:
- depends-phased-new phased phased-depends-ready-dep ready-dep
+ depends-phased-new ready-dep
The following packages will be upgraded:
depends-phased-dep phased-dep phased-security phased-security-same
4 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
diff --git a/test/integration/test-ubuntu-bug-2025462-phased-dist-upgrade b/test/integration/test-ubuntu-bug-2025462-phased-dist-upgrade
index eecadcda3..567864230 100755
--- a/test/integration/test-ubuntu-bug-2025462-phased-dist-upgrade
+++ b/test/integration/test-ubuntu-bug-2025462-phased-dist-upgrade
@@ -32,8 +32,10 @@ setupaptarchive
testsuccessequal "Reading package lists...
Building dependency tree...
Calculating upgrade...
+The following upgrades have been deferred due to phasing:
+ mutter
The following packages have been kept back:
- gnome-shell gnome-shell-common mutter
+ gnome-shell gnome-shell-common
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded." aptget dist-upgrade -s -q
testsuccessequal "Reading package lists...