Added the config option to disable flatpaks (disabled by default), and the flag --no-flatpaks which will skip flatpak packages.

This commit is contained in:
Dávid Groniewsky
2025-09-30 22:30:24 +02:00
parent 0ecd835090
commit 9ce42ccf3e
2 changed files with 17 additions and 3 deletions
+13
View File
@@ -1,3 +1,4 @@
# pyright: reportUnusedCallResult=false
""" """
Module containing the CLI Application. Module containing the CLI Application.
""" """
@@ -27,6 +28,7 @@ def main():
epilog="See more help at: https://github.com/kiviktnm/decman", epilog="See more help at: https://github.com/kiviktnm/decman",
) )
parser.add_argument( parser.add_argument(
"--source", action="store", help="python file containing configuration" "--source", action="store", help="python file containing configuration"
) )
@@ -52,6 +54,12 @@ def main():
default=False, default=False,
help="don't upgrade foreign packages", help="don't upgrade foreign packages",
) )
parser.add_argument(
"--no-flatpaks",
action="store_true",
default=False,
help="don't upgrade flatpak packages",
)
parser.add_argument( parser.add_argument(
"--no-files", action="store_true", default=False, help="don't install any files" "--no-files", action="store_true", default=False, help="don't install any files"
) )
@@ -177,6 +185,7 @@ def _set_up(store: l.Store, args):
args.print, args.print,
not args.no_packages, not args.no_packages,
not args.no_foreign_packages, not args.no_foreign_packages,
not args.no_flatpaks
not args.no_files, not args.no_files,
not args.no_systemd_units, not args.no_systemd_units,
not args.no_commands, not args.no_commands,
@@ -195,6 +204,7 @@ class Core:
self.only_print, self.only_print,
self.update_packages, self.update_packages,
self.update_foreign_packages, self.update_foreign_packages,
self.update_flatpaks,
self.update_files, self.update_files,
self.update_units, self.update_units,
self.run_commands, self.run_commands,
@@ -279,6 +289,7 @@ class Core:
self.pacman.remove(to_remove) self.pacman.remove(to_remove)
# flatpak # flatpak
if conf.enable_flatpak and self.update_flatpaks:
self.flatpak.remove(to_remove_flatpak) self.flatpak.remove(to_remove_flatpak)
def _upgrade_pkgs(self): def _upgrade_pkgs(self):
@@ -297,6 +308,7 @@ class Core:
) )
# flatpak # flatpak
if conf.enable_flatpak and self.update_flatpaks:
self.flatpak.upgrade() self.flatpak.upgrade()
def _install_pkgs(self): def _install_pkgs(self):
@@ -327,6 +339,7 @@ class Core:
if conf.enable_fpm and self.update_foreign_packages: if conf.enable_fpm and self.update_foreign_packages:
self.fpm.install(to_install_fpm, force=self.force_build) self.fpm.install(to_install_fpm, force=self.force_build)
if conf.enable_flatpak and self.update_flatpaks:
self.flatpak.install(to_install_flatpak) self.flatpak.install(to_install_flatpak)
def _create_and_remove_files(self): def _create_and_remove_files(self):
+1
View File
@@ -265,4 +265,5 @@ build_dir: str = "/tmp/decman/build"
pkg_cache_dir: str = "/var/cache/decman" pkg_cache_dir: str = "/var/cache/decman"
aur_rpc_timeout: typing.Optional[int] = 30 aur_rpc_timeout: typing.Optional[int] = 30
enable_fpm: bool = True enable_fpm: bool = True
enable_flatpak: bool = False
number_of_packages_stored_in_cache: int = 3 number_of_packages_stored_in_cache: int = 3