Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/__init__.py
diff options
context:
space:
mode:
authorDaniel Girtler <blackrabbit256@gmail.com>2023-10-18 16:57:44 +1100
committerGitHub <noreply@github.com>2023-10-18 16:57:44 +1100
commitce9828c2934937217daee6ba178dafedf6cabe6d (patch)
tree0c9540f07c6756426e50786a04b4436ef3b51577 /archinstall/__init__.py
parent8117c0eed8cdeffc542026a82a51cb10fd6c1ec4 (diff)
Fixes for prev PR (#2175)
* Fixes for prev PR * Update --------- Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
Diffstat (limited to 'archinstall/__init__.py')
-rw-r--r--archinstall/__init__.py21
1 files changed, 18 insertions, 3 deletions
diff --git a/archinstall/__init__.py b/archinstall/__init__.py
index 3949d38a..b9a0c2fb 100644
--- a/archinstall/__init__.py
+++ b/archinstall/__init__.py
@@ -89,6 +89,8 @@ def define_arguments():
parser.add_argument("--no-pkg-lookups", action="store_true", default=False,
help="Disabled package validation specifically prior to starting installation.")
parser.add_argument("--plugin", nargs="?", type=str)
+ parser.add_argument("--skip-version-check", action="store_true",
+ help="Skip the version check when running archinstall")
def parse_unspecified_argument_list(unknowns: list, multiple: bool = False, err: bool = False) -> dict:
@@ -280,8 +282,20 @@ def plugin(f, *args, **kwargs):
def _check_new_version():
info("Checking version...")
- Pacman.run("-Sy")
- upgrade = Pacman.run("-Qu archinstall").decode()
+
+ try:
+ Pacman.run("-Sy")
+ except Exception as e:
+ debug(f'Failed to perform version check: {e}')
+ info(f'Arch Linux mirrors are not reachable. Please check your internet connection')
+ exit(1)
+
+ upgrade = None
+
+ try:
+ upgrade = Pacman.run("-Qu archinstall").decode()
+ except Exception as e:
+ debug(f'Failed determine pacman version: {e}')
if upgrade:
text = f'New version available: {upgrade}'
@@ -295,7 +309,8 @@ def main():
OR straight as a module: python -m archinstall
In any case we will be attempting to load the provided script to be run from the scripts/ folder
"""
- _check_new_version()
+ if not arguments.get('skip_version_check', False):
+ _check_new_version()
script = arguments.get('script', None)