[neon/forks/ubuntu-release-upgrader/Neon/unstable_focal] DistUpgrade: Upgrade all snaps which track latest/stable/ubuntu- rather than add them to deb2snap.json

Brian Murray null at kde.org
Wed Apr 28 11:06:46 BST 2021


Git commit 463fc289ddb6987953a6fcc3b5f942084679cf59 by Brian Murray.
Committed on 13/04/2021 at 18:33.
Pushed by jriddell into branch 'Neon/unstable_focal'.

Upgrade all snaps which track latest/stable/ubuntu- rather than add them to deb2snap.json

M  +14   -0    DistUpgrade/DistUpgradeQuirks.py
M  +0    -2    DistUpgrade/deb2snap.json

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

diff --git a/DistUpgrade/DistUpgradeQuirks.py b/DistUpgrade/DistUpgradeQuirks.py
index ffca4551..62406a0b 100644
--- a/DistUpgrade/DistUpgradeQuirks.py
+++ b/DistUpgrade/DistUpgradeQuirks.py
@@ -988,6 +988,20 @@ class DistUpgradeQuirks(object):
         except Exception as e:
             logging.warning("error reading deb2snap.json file (%s)" % e)
 
+        # list the installed snaps and add them to seeded ones
+        snap_list = subprocess.Popen(["snap", "list"],
+                                     universal_newlines=True,
+                                     stdout=subprocess.PIPE).communicate()
+        # first line of output is a header and the last line is empty
+        snaps_installed = [line.split()[0] \
+                           for line in snap_list[0].split('\n')[1:-1]]
+
+        for snap in snaps_installed:
+            if snap in seeded_snaps or snap in unseeded_snaps:
+                continue
+            else:
+                seeded_snaps[snap] = (None, from_channel, to_channel)
+
         self._view.updateStatus(_("Checking for installed snaps"))
         for snap, (deb, from_channel, to_channel) in seeded_snaps.items():
             snap_object = {}
diff --git a/DistUpgrade/deb2snap.json b/DistUpgrade/deb2snap.json
index aeb72bc3..3b57b98a 100644
--- a/DistUpgrade/deb2snap.json
+++ b/DistUpgrade/deb2snap.json
@@ -13,8 +13,6 @@
         "snap-store": {
             "deb": "gnome-software",
             "metapkg": "ubuntu-desktop"
-        },
-        "google-cloud-sdk": {
         }
     },
     "unseeded": {



More information about the Neon-commits mailing list