]> git.mar77i.info Git - localapps/commitdiff
fix uninstall before upgrade, and minor cleanups master
authormar77i <mar77i@protonmail.ch>
Tue, 24 Feb 2026 08:50:12 +0000 (09:50 +0100)
committermar77i <mar77i@protonmail.ch>
Tue, 24 Feb 2026 08:50:12 +0000 (09:50 +0100)
apps/ungoogled_chromium.py
localapps.py

index 40177bcfa61fd4be8cd790394d48caa47bea04a6..a5d14ae1398b4710906a88df4f95133e80acdfea 100644 (file)
@@ -132,9 +132,9 @@ class UngoogledChromium(AppBase):
     @classmethod
     def uninstall(cls):
         rmtree(cls.BIN_PATH.parent)
-        (
-            cls.get_xdg_home() / "applications" / "ungoogled-chromium.desktop"
-        ).unlink(missing_ok=True)
+        (cls.get_xdg_home() / "applications" / "ungoogled-chromium.desktop").unlink(
+            missing_ok=True
+        )
         for size in (16, 24, 32, 48, 64, 128, 256):
             (
                 cls.get_xdg_home()
index 3fb26915ce7a65b8ea6e5f295da11c0b352f4ee2..c8fc783b9a97fb29be1102e446b4e4b900390711 100755 (executable)
@@ -61,9 +61,11 @@ class AppBase:
 
     @classmethod
     def upgrade(cls):
-        if cls.get_installed_version() == cls.get_latest_version():
+        installed_version = cls.get_installed_version()
+        if installed_version == cls.get_latest_version():
             return
-        cls.uninstall()
+        elif installed_version is not None:
+            cls.uninstall()
         cls.install()
 
     @classmethod
@@ -145,11 +147,18 @@ class LocalAppsManager:
             print(" installed", installed)
 
     def upgrade(self):
+        if self.args.check:
+            for app in AppBase.registry:
+                if app.get_installed_version() != app.get_installed_version():
+                    print(app.NAME)
+            else:
+                print("No updates pending.")
+            return
         for app in AppBase.registry:
             installed = app.get_installed_version()
             if installed is None:
                 continue
-            print("upgrade stub", app.NAME)
+            app.upgrade()
 
     def get_pending_apps(self):
         app_names_upper = [app_name.upper() for app_name in self.args.app_names]