From c08520f9902aeb1b4ce22e1159060792081b0327 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Wed, 2 Feb 2022 14:22:52 +0100 Subject: SysCommand() to remove ANSII VT100 Esc codes & archlinux-keyring fix (#933) * Fixed SysCommandWorker() so that it removes ANSII VT100 escape codes. I also moved package.py into it's own folder, as that's something I want to expand on a lot, so package related stuff should go in there. I created a installed_package() function which gets information about the locally installed package. I changed so that find_packages() and find_package() returns a data-model instead for the package information. This should unify and make sure we detect issues down the line. * Working on structuring .version constructor that works with BaseModel * Added version contructors to VersionDef(). Also added __eq__ and __lt__ to LocalPackage() and PackageSearchResult(). * removed debug and added a TODO * Removed whitespace * Removed mirror-database function from myrepo --- examples/guided.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'examples/guided.py') diff --git a/examples/guided.py b/examples/guided.py index 22e0f883..45e213df 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -309,10 +309,17 @@ if not (archinstall.check_mirror_reachable() or archinstall.arguments.get('skip- archinstall.log(f"Arch Linux mirrors are not reachable. Please check your internet connection and the log file '{log_file}'.", level=logging.INFO, fg="red") exit(1) -if not (archinstall.update_keyring() or archinstall.arguments.get('skip-keyring-update', False)): - log_file = os.path.join(archinstall.storage.get('LOG_PATH', None), archinstall.storage.get('LOG_FILE', None)) - archinstall.log(f"Failed to update the keyring. Please check your internet connection and the log file '{log_file}'.", level=logging.INFO, fg="red") - exit(1) +if not archinstall.arguments.get('offline', False): + # If we want to check for keyring updates + # and the installed package version is lower than the upstream version + if archinstall.arguments.get('skip-keyring-update', False) is False and \ + archinstall.installed_package('archlinux-keyring') < archinstall.find_package('archlinux-keyring'): + + # Then we update the keyring in the ISO environment + if not archinstall.update_keyring(): + log_file = os.path.join(archinstall.storage.get('LOG_PATH', None), archinstall.storage.get('LOG_FILE', None)) + archinstall.log(f"Failed to update the keyring. Please check your internet connection and the log file '{log_file}'.", level=logging.INFO, fg="red") + exit(1) load_config() if not archinstall.arguments.get('silent'): -- cgit v1.2.3-70-g09d2