From 2de153003ed5de1018639070fabc9c9e583c49d1 Mon Sep 17 00:00:00 2001 From: Kian-Meng Ang Date: Sun, 29 May 2022 15:31:18 +0800 Subject: Fix typos (#1265) --- profiles/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'profiles') diff --git a/profiles/server.py b/profiles/server.py index 21681c2f..f3e32d26 100644 --- a/profiles/server.py +++ b/profiles/server.py @@ -33,7 +33,7 @@ def _prep_function(*args, **kwargs): before continuing any further. """ choice = Menu(str(_( - 'Choose which servers to install, if none then a minimal installation wil be done')), + 'Choose which servers to install, if none then a minimal installation will be done')), available_servers, preset_values=kwargs['servers'], multi=True -- cgit v1.2.3-70-g09d2 From 32442ac7f36d71f0ba0d10bb5db19afa4a099e23 Mon Sep 17 00:00:00 2001 From: LittleboyHarry Date: Fri, 3 Jun 2022 14:50:59 +0800 Subject: Add `packagekit-qt5` for kde (#1300) fix #1041 --- profiles/kde.py | 1 + 1 file changed, 1 insertion(+) (limited to 'profiles') diff --git a/profiles/kde.py b/profiles/kde.py index 9edbe325..3de2dbad 100644 --- a/profiles/kde.py +++ b/profiles/kde.py @@ -13,6 +13,7 @@ __packages__ = [ "sddm", "plasma-wayland-session", "egl-wayland", + "packagekit-qt5", ] -- cgit v1.2.3-70-g09d2 From 86531ef62f777f91ef2f4ca7d102abdfccb11ded Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 9 Jun 2022 12:32:01 -0400 Subject: Remove packagekit (#1322) * Remove packagekit * Update kde.py --- profiles/gnome.py | 3 +-- profiles/kde.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'profiles') diff --git a/profiles/gnome.py b/profiles/gnome.py index d647ddc8..5e3a8da6 100644 --- a/profiles/gnome.py +++ b/profiles/gnome.py @@ -8,8 +8,7 @@ is_top_level_profile = False __packages__ = [ "gnome", "gnome-tweaks", - "gdm", - "gnome-software-packagekit-plugin", + "gdm" ] diff --git a/profiles/kde.py b/profiles/kde.py index 3de2dbad..d32bf31b 100644 --- a/profiles/kde.py +++ b/profiles/kde.py @@ -12,8 +12,7 @@ __packages__ = [ "ark", "sddm", "plasma-wayland-session", - "egl-wayland", - "packagekit-qt5", + "egl-wayland" ] -- cgit v1.2.3-70-g09d2 From 1086fd686d28317851c7f09eb00898648ecaaad7 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Thu, 11 Aug 2022 18:06:02 +0200 Subject: Cleaned up argument loading slighly. (#1419) * Cleaned up argument loading slighly. Also flipped some --silent logic to avoid double negatives. --plugin and --conf {'plugin': ...} should now both work. * Tweaked xorg profile to use list instead of strings. Because strings causes some issues through add_additional_packages() as it ends up as [(xorg, xorg-xinit), nano] instead of a flat list of packages or string. * Tweaked xorg profile to use list instead of strings. Because strings causes some issues through add_additional_packages() as it ends up as [(xorg, xorg-xinit), nano] instead of a flat list of packages or string. --- archinstall/__init__.py | 30 +++++++++++++++++++++++++----- archinstall/lib/plugins.py | 2 ++ profiles/xorg.py | 10 +++++----- 3 files changed, 32 insertions(+), 10 deletions(-) (limited to 'profiles') diff --git a/archinstall/__init__.py b/archinstall/__init__.py index 3e9f8391..090ad7de 100644 --- a/archinstall/__init__.py +++ b/archinstall/__init__.py @@ -1,5 +1,6 @@ """Arch Linux installer - guided, templates etc.""" -from argparse import ArgumentParser +import typing +from argparse import ArgumentParser, Namespace from .lib.disk import * from .lib.exceptions import * @@ -132,6 +133,24 @@ def parse_unspecified_argument_list(unknowns :list, multiple :bool = False, erro print(f" We ignore the entry {element} as it isn't related to any argument") return config +def cleanup_empty_args(args :typing.Union[Namespace, dict]) -> dict: + """ + Takes arguments (dictionary or argparse Namespace) and removes any + None values. This ensures clean mergers during dict.update(args) + """ + if type(args) == Namespace: + args = vars(args) + + clean_args = {} + for key, val in args.items(): + if type(val) == dict: + val = cleanup_empty_args(val) + + if val is not None: + clean_args[key] = val + + return clean_args + def get_arguments() -> Dict[str, Any]: """ The handling of parameters from the command line Is done on following steps: @@ -159,14 +178,15 @@ def get_arguments() -> Dict[str, Any]: exit(1) # load the parameters. first the known, then the unknowns - config.update(vars(args)) + args = cleanup_empty_args(args) + config.update(args) config.update(parse_unspecified_argument_list(unknowns)) # amend the parameters (check internal consistency) # Installation can't be silent if config is not passed - if args.config is not None : - config["silent"] = args.silent - else: + if args.get('config') is None: config["silent"] = False + else: + config["silent"] = args.get('silent') # avoiding a compatibility issue if 'dry-run' in config: diff --git a/archinstall/lib/plugins.py b/archinstall/lib/plugins.py index f771aacb..0ff63610 100644 --- a/archinstall/lib/plugins.py +++ b/archinstall/lib/plugins.py @@ -73,6 +73,7 @@ def find_nth(haystack :List[str], needle :str, n :int) -> int: def load_plugin(path :str) -> ModuleType: parsed_url = urllib.parse.urlparse(path) + log(f"Loading plugin {parsed_url}.", fg="gray", level=logging.INFO) # The Profile was not a direct match on a remote URL if not parsed_url.scheme: @@ -96,6 +97,7 @@ def load_plugin(path :str) -> ModuleType: if hasattr(sys.modules[namespace], 'Plugin'): try: plugins[namespace] = sys.modules[namespace].Plugin() + log(f"Plugin {plugins[namespace]} has been loaded.", fg="gray", level=logging.INFO) except Exception as err: log(err, level=logging.ERROR) log(f"The above error was detected when initiating the plugin: {path}", fg="red", level=logging.ERROR) diff --git a/profiles/xorg.py b/profiles/xorg.py index 2ce8dcc2..de45acd3 100644 --- a/profiles/xorg.py +++ b/profiles/xorg.py @@ -47,9 +47,9 @@ if __name__ == 'xorg': for kernel in archinstall.storage['installation_session'].kernels: archinstall.storage['installation_session'].add_additional_packages(f"{kernel}-headers") # Fixes https://github.com/archlinux/archinstall/issues/585 archinstall.storage['installation_session'].add_additional_packages("dkms") # I've had kernel regen fail if it wasn't installed before nvidia-dkms - archinstall.storage['installation_session'].add_additional_packages("xorg-server xorg-xinit nvidia-dkms") + archinstall.storage['installation_session'].add_additional_packages("xorg-server", "xorg-xinit", "nvidia-dkms") else: - archinstall.storage['installation_session'].add_additional_packages(f"xorg-server xorg-xinit {' '.join(archinstall.storage.get('gfx_driver_packages', []))}") + archinstall.storage['installation_session'].add_additional_packages(f"xorg-server", "xorg-xinit", *archinstall.storage.get('gfx_driver_packages', [])) elif 'amdgpu' in archinstall.storage.get("gfx_driver_packages", []): # The order of these two are important if amdgpu is installed #808 if 'amdgpu' in archinstall.storage['installation_session'].MODULES: @@ -60,9 +60,9 @@ if __name__ == 'xorg': archinstall.storage['installation_session'].MODULES.remove('radeon') archinstall.storage['installation_session'].MODULES.append('radeon') - archinstall.storage['installation_session'].add_additional_packages(f"xorg-server xorg-xinit {' '.join(archinstall.storage.get('gfx_driver_packages', []))}") + archinstall.storage['installation_session'].add_additional_packages(f"xorg-server", "xorg-xinit", *archinstall.storage.get('gfx_driver_packages', [])) else: - archinstall.storage['installation_session'].add_additional_packages(f"xorg-server xorg-xinit {' '.join(archinstall.storage.get('gfx_driver_packages', []))}") + archinstall.storage['installation_session'].add_additional_packages(f"xorg-server", "xorg-xinit", *archinstall.storage.get('gfx_driver_packages', [])) except Exception as err: archinstall.log(f"Could not handle nvidia and linuz-zen specific situations during xorg installation: {err}", level=logging.WARNING, fg="yellow") - archinstall.storage['installation_session'].add_additional_packages("xorg-server xorg-xinit") # Prep didn't run, so there's no driver to install + archinstall.storage['installation_session'].add_additional_packages("xorg-server", "xorg-xinit") # Prep didn't run, so there's no driver to install -- cgit v1.2.3-70-g09d2