Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/user_interaction
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2022-06-02 13:32:42 +0200
committerGitHub <noreply@github.com>2022-06-02 13:32:42 +0200
commit7943dd82365fd9fb5034a0f1c05de3ccabda468a (patch)
tree5e006c48d6f39d6f551aa441de6a386153ab2364 /archinstall/lib/user_interaction
parentc2be07e7dc543fd6c5b60e67153061b2136b8575 (diff)
Added more offline functionality, such as skipping package search (#1296)
* Added more offline functionality, such as skipping package search * Disabled list_mirrors() from going online if --offline is given. Defaults to /etc/pacman.d/mirrorlist instead. * Forgot import of pathlib * Made list_mirrors() open /etc/pacman.d/mirrorlist in byte mode to better emulate the result of urllib response reading. * Forgot variable declaration * Made list_mirrors include activated server definitions
Diffstat (limited to 'archinstall/lib/user_interaction')
-rw-r--r--archinstall/lib/user_interaction/general_conf.py37
1 files changed, 19 insertions, 18 deletions
diff --git a/archinstall/lib/user_interaction/general_conf.py b/archinstall/lib/user_interaction/general_conf.py
index f1d56fc1..70a0e73f 100644
--- a/archinstall/lib/user_interaction/general_conf.py
+++ b/archinstall/lib/user_interaction/general_conf.py
@@ -3,8 +3,6 @@ from __future__ import annotations
import logging
from typing import List, Any, Optional, Dict, TYPE_CHECKING
-import archinstall
-
from ..menu.menu import MenuSelectionType
from ..menu.text_input import TextInput
@@ -17,6 +15,8 @@ from ..mirrors import list_mirrors
from ..translation import Translation
from ..packages.packages import validate_package_list
+from ..storage import storage
+
if TYPE_CHECKING:
_: Any
@@ -155,11 +155,11 @@ def select_profile(preset) -> Optional[Profile]:
case MenuSelectionType.Selection:
return options[selection.value] if selection.value is not None else None
case MenuSelectionType.Ctrl_c:
- archinstall.storage['profile_minimal'] = False
- archinstall.storage['_selected_servers'] = []
- archinstall.storage['_desktop_profile'] = None
- archinstall.arguments['desktop-environment'] = None
- archinstall.arguments['gfx_driver_packages'] = None
+ storage['profile_minimal'] = False
+ storage['_selected_servers'] = []
+ storage['_desktop_profile'] = None
+ storage['arguments']['desktop-environment'] = None
+ storage['arguments']['gfx_driver_packages'] = None
return None
case MenuSelectionType.Esc:
return None
@@ -178,17 +178,18 @@ def ask_additional_packages_to_install(pre_set_packages: List[str] = []) -> List
pre_set_packages = pre_set_packages if pre_set_packages else []
packages = read_packages(pre_set_packages)
- while True:
- if len(packages):
- # Verify packages that were given
- print(_("Verifying that additional packages exist (this might take a few seconds)"))
- valid, invalid = validate_package_list(packages)
-
- if invalid:
- log(f"Some packages could not be found in the repository: {invalid}", level=logging.WARNING, fg='red')
- packages = read_packages(valid)
- continue
- break
+ if not storage['arguments']['offline'] and not storage['arguments']['no_pkg_lookups']:
+ while True:
+ if len(packages):
+ # Verify packages that were given
+ print(_("Verifying that additional packages exist (this might take a few seconds)"))
+ valid, invalid = validate_package_list(packages)
+
+ if invalid:
+ log(f"Some packages could not be found in the repository: {invalid}", level=logging.WARNING, fg='red')
+ packages = read_packages(valid)
+ continue
+ break
return packages