Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/networking.py
diff options
context:
space:
mode:
authorDaniel <blackrabbit256@gmail.com>2022-02-18 21:33:28 +1100
committerGitHub <noreply@github.com>2022-02-18 11:33:28 +0100
commit4b3b21ed756463914d618abe11345c9839217473 (patch)
tree94fecd8d11262a5423d6af3805f24d63012519b5 /archinstall/lib/networking.py
parent62a6aec197b0e83ab91fdec1ab15427ecf749dac (diff)
Check if pacman is available (#958)
* Check if pacman is available * Update pacman call * Added a graceful wait to `run_pacman` * Fix flake8 Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com> Co-authored-by: Anton Hvornum <anton.feeds+github@gmail.com>
Diffstat (limited to 'archinstall/lib/networking.py')
-rw-r--r--archinstall/lib/networking.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/archinstall/lib/networking.py b/archinstall/lib/networking.py
index 5331216c..3e883a7b 100644
--- a/archinstall/lib/networking.py
+++ b/archinstall/lib/networking.py
@@ -7,6 +7,7 @@ from typing import Union, Dict, Any, List
from .exceptions import HardwareIncompatibilityError
from .general import SysCommand
from .output import log
+from .pacman import run_pacman
from .storage import storage
@@ -32,7 +33,7 @@ def list_interfaces(skip_loopback :bool = True) -> Dict[str, str]:
def check_mirror_reachable() -> bool:
log("Testing connectivity to the Arch Linux mirrors ...", level=logging.INFO)
- if SysCommand("pacman -Sy").exit_code == 0:
+ if run_pacman("-Sy").exit_code == 0:
return True
elif os.geteuid() != 0:
@@ -42,9 +43,9 @@ def check_mirror_reachable() -> bool:
def update_keyring() -> bool:
log("Updating archlinux-keyring ...", level=logging.INFO)
- if SysCommand("pacman -Sy --noconfirm archlinux-keyring").exit_code == 0:
+ if run_pacman("-Sy --noconfirm 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")