From d765eea3f46f6725f4022c688930efa4d1e5f6c7 Mon Sep 17 00:00:00 2001 From: David Groniewsky Date: Wed, 8 Oct 2025 19:13:08 +0200 Subject: [PATCH] Simple fixes --- example/my_module.py | 2 +- src/decman/app.py | 14 +++++++++----- src/decman/lib/__init__.py | 3 +++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/example/my_module.py b/example/my_module.py index 16a6e54..33edebf 100644 --- a/example/my_module.py +++ b/example/my_module.py @@ -117,7 +117,7 @@ class MyModule(Module): return ["org.mozilla.firefox"] def flatpak_user_packages(self) -> list[str]: - return ["org.github.kolunmi.Bazaar"] + return ["io.github.kolunmi.Bazaar"] def systemd_units(self) -> list[str]: return ["reflector.timer"] diff --git a/src/decman/app.py b/src/decman/app.py index 24ea995..f9f353c 100644 --- a/src/decman/app.py +++ b/src/decman/app.py @@ -216,7 +216,7 @@ class Core: l.print_error( "Flatpaks have been enabled in the source file, but the flatpak command could not be found. Either disable flatpaks or make sure that flatpak is installed and can be accessed by decman. Exiting." ) - exit() + sys.exit(1) self.store = store self.source = _resolve_source() @@ -291,8 +291,10 @@ class Core: ) l.print_list("Removing pacman packages:", to_remove) - l.print_list("Removing flatpak packages:", to_remove_flatpak) - l.print_list("Removing user flatpak packages:", to_remove_user_flatpak) + + if conf.enable_flatpak: + l.print_list("Removing flatpak packages:", to_remove_flatpak) + l.print_list("Removing user flatpak packages:", to_remove_user_flatpak) if self.only_print: return @@ -344,8 +346,10 @@ class Core: ) l.print_list("Installing pacman packages:", to_install_pacman) - l.print_list("Installing flatpak packages:", to_install_flatpak) - l.print_list("Installing user flatpak packages:", to_install_user_flatpak) + + if conf.enable_flatpak: + l.print_list("Installing flatpak packages:", to_install_flatpak) + l.print_list("Installing user flatpak packages:", to_install_user_flatpak) # fpm prints a summary so no need to print it twice if self.only_print: diff --git a/src/decman/lib/__init__.py b/src/decman/lib/__init__.py index 0e52fe6..276f357 100644 --- a/src/decman/lib/__init__.py +++ b/src/decman/lib/__init__.py @@ -998,6 +998,9 @@ class Flatpak: if "Application ID" in packages: packages.remove("Application ID") + if packages == [""]: + return [] + return packages except subprocess.CalledProcessError as error: raise err.UserFacingError(