[neon-notifications] [neon/forks/ubuntu-release-upgrader/Neon/unstable_focal] /: DistUpgrade/DistUpgradeCache.py: Ensure that the linux metapackage is never removed during a distribution upgrade. (LP: #1889449)
Brian Murray
null at kde.org
Wed Sep 23 10:41:40 BST 2020
Git commit f4d4d69ee42faa7c45adf2e209f9bfe2361b1aaa by Brian Murray.
Committed on 03/08/2020 at 16:25.
Pushed by sitter into branch 'Neon/unstable_focal'.
DistUpgrade/DistUpgradeCache.py: Ensure that the linux metapackage is never removed during a distribution upgrade. (LP: #1889449)
M +7 -1 DistUpgrade/DistUpgradeCache.py
M +7 -0 debian/changelog
https://invent.kde.org/neon/forks/ubuntu-release-upgrader/commit/f4d4d69ee42faa7c45adf2e209f9bfe2361b1aaa
diff --git a/DistUpgrade/DistUpgradeCache.py b/DistUpgrade/DistUpgradeCache.py
index b2dd0867..72c4361f 100644
--- a/DistUpgrade/DistUpgradeCache.py
+++ b/DistUpgrade/DistUpgradeCache.py
@@ -140,6 +140,8 @@ class MyCache(apt.Cache):
apt.Cache.__init__(self, progress)
# a list of regexp that are not allowed to be removed
self.removal_blacklist = config.getListFromFile("Distro", "RemovalBlacklistFile")
+ # the linux metapackage should not be removed
+ self.linux_metapackage = self.quirks._get_linux_metapackage(self, False)
self.uname = Popen(["uname", "-r"], stdout=PIPE,
universal_newlines=True).communicate()[0].strip()
self._initAptLog()
@@ -949,6 +951,9 @@ class MyCache(apt.Cache):
if pkgname.endswith(self.uname):
logging.debug("skipping running kernel pkg '%s'" % pkgname)
return False
+ if pkgname == self.linux_metapackage:
+ logging.debug("skipping kernel metapackage '%s'" % pkgname)
+ return False
if self._inRemovalBlacklist(pkgname):
logging.debug("skipping '%s' (in removalBlacklist)" % pkgname)
return False
@@ -986,7 +991,8 @@ class MyCache(apt.Cache):
for pkg in self.get_changes():
if (pkg.name not in remove_candidates or
pkg.name in foreign_pkgs or
- self._inRemovalBlacklist(pkg.name)):
+ self._inRemovalBlacklist(pkg.name) or
+ pkg.name == self.linux_metapackage):
logging.debug("package '%s' produces an unwanted removal '%s', skipping" % (pkgname, pkg.name))
self.restore_snapshot()
return False
diff --git a/debian/changelog b/debian/changelog
index 29d24e04..4ac3a87c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+ubuntu-release-upgrader (1:20.04.24) UNRELEASED; urgency=medium
+
+ * DistUpgrade/DistUpgradeCache.py: Ensure that the linux metapackage is
+ never removed during a distribution upgrade. (LP: #1889449)
+
+ -- Brian Murray <brian at ubuntu.com> Mon, 03 Aug 2020 09:23:23 -0700
+
ubuntu-release-upgrader (1:20.04.23) focal; urgency=medium
* data/DistUpgrade.cfg: remove xscreensaver from the PostUpgradeRemove rule
More information about the neon-notifications
mailing list