[neon/forks/ubuntu-release-upgrader/Neon/unstable_jammy] DistUpgrade: remove old pins before upgrade

Jonathan Esk-Riddell null at kde.org
Mon Sep 26 14:12:49 BST 2022


Git commit abe9461f7162a847e707c2b595c77e52c88a6ff8 by Jonathan Esk-Riddell.
Committed on 26/09/2022 at 13:12.
Pushed by jriddell into branch 'Neon/unstable_jammy'.

remove old pins before upgrade

M  +9    -1    DistUpgrade/DistUpgradeQuirks.py

https://invent.kde.org/neon/forks/ubuntu-release-upgrader/commit/abe9461f7162a847e707c2b595c77e52c88a6ff8

diff --git a/DistUpgrade/DistUpgradeQuirks.py b/DistUpgrade/DistUpgradeQuirks.py
index 42691782..de803359 100644
--- a/DistUpgrade/DistUpgradeQuirks.py
+++ b/DistUpgrade/DistUpgradeQuirks.py
@@ -145,7 +145,7 @@ class DistUpgradeQuirks(object):
         # dependency resolution problems caused by old pins.
         # This includes the neon-settings pin. The future package shouldn't include
         # the legacy pin in its neon-settings!
-        for old_pin in ['98-xenial-overrides', '99-xenial-overrides', '98-focal-overrides', '98-jammy-overrides']:
+        for old_pin in ['98-jammy-overrides']:
             path = '/etc/apt/preferences.d/' + old_pin
             if os.path.exists(path):
                 os.remove(path)
@@ -190,6 +190,14 @@ class DistUpgradeQuirks(object):
         # self._install_python_is_python2()
         # neon packages with versions < in focal
         copyfile('98-jammy-overrides', '/etc/apt/preferences.d/98-jammy-overrides')
+        # Make sure legacy pins are cleaned up before doing anything to prevent
+        # dependency resolution problems caused by old pins.
+        # This includes the neon-settings pin. The future package shouldn't include
+        # the legacy pin in its neon-settings!
+        for old_pin in ['98-xenial-overrides', '99-xenial-overrides', '98-focal-overrides', '99-focal-overrides']:
+            path = '/etc/apt/preferences.d/' + old_pin
+            if os.path.exists(path):
+                os.remove(path)
 
     # individual quirks handler that run *after* the dist-upgrade was
     # calculated in the cache


More information about the Neon-commits mailing list