From: mar77i Date: Tue, 24 Feb 2026 08:50:12 +0000 (+0100) Subject: fix uninstall before upgrade, and minor cleanups X-Git-Url: https://git.mar77i.info/?a=commitdiff_plain;p=localapps fix uninstall before upgrade, and minor cleanups --- diff --git a/apps/ungoogled_chromium.py b/apps/ungoogled_chromium.py index 40177bc..a5d14ae 100644 --- a/apps/ungoogled_chromium.py +++ b/apps/ungoogled_chromium.py @@ -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() diff --git a/localapps.py b/localapps.py index 3fb2691..c8fc783 100755 --- a/localapps.py +++ b/localapps.py @@ -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]