From 179c103cddf930b91ffa82a9feee37c7f2487ed8 Mon Sep 17 00:00:00 2001 From: Timothy Pidashev Date: Sun, 30 Jan 2022 02:01:04 -0800 Subject: Synchronize `archlinux-keyring` when running guided.py (#917) * Update guided.py * Update guided.py * Update guided.py * Fix typo * Format string properly; elaborate log msg * Make change consistent to mirror-check * Update documentation --- archinstall/lib/networking.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'archinstall') diff --git a/archinstall/lib/networking.py b/archinstall/lib/networking.py index 6b09deba..82754b58 100644 --- a/archinstall/lib/networking.py +++ b/archinstall/lib/networking.py @@ -40,6 +40,16 @@ def check_mirror_reachable() -> bool: return False +def update_keyring() -> bool: + log("Updating archlinux-keyring ...", level=logging.INFO) + if SysCommand("pacman -Sy archlinux-keyring").exit_code == 0: + return True + + elif os.geteuid() != 0: + log("update_keyring() uses 'pacman -Sy archlinux-keyring' which requires root.", level=logging.ERROR, fg="red") + + return False + def enrich_iface_types(interfaces: Union[Dict[str, Any], List[str]]) -> Dict[str, str]: result = {} -- cgit v1.2.3-70-g09d2