Updated the loop logic for packages

It wouldn't loop over the question again, so correct for that.
This commit is contained in:
Anton Hvornum 2021-04-14 12:06:15 +02:00 committed by GitHub
parent c07d286f57
commit 99fb1304ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 9 deletions

View File

@ -183,22 +183,24 @@ def ask_user_questions():
archinstall.arguments['audio'] = None archinstall.arguments['audio'] = None
# Additional packages (with some light weight error handling for invalid package names) # Additional packages (with some light weight error handling for invalid package names)
while True:
if not archinstall.arguments.get('packages', None): if not archinstall.arguments.get('packages', None):
print("Packages not part of the desktop environment are not installed by default.") print("Only packages such as base, base-devel, linux, linux-firmware, efibootmgr and optional profile packages are installed.")
print("If you desire a web browser, such as firefox or chromium, you may specify it in the following prompt.") print("If you desire a web browser, such as firefox or chromium, you may specify it in the following prompt.")
archinstall.arguments['packages'] = [package for package in input('Write additional packages to install (space separated, leave blank to skip): ').split(' ') if len(package)] archinstall.arguments['packages'] = [package for package in input('Write additional packages to install (space separated, leave blank to skip): ').split(' ') if len(package)]
if len(archinstall.arguments['packages']): if len(archinstall.arguments['packages']):
invalid_packages = True
while invalid_packages == True:
# Verify packages that were given # Verify packages that were given
try: try:
archinstall.log(f"Verifying that additional packages exist (this might take a few seconds)") archinstall.log(f"Verifying that additional packages exist (this might take a few seconds)")
archinstall.validate_package_list(archinstall.arguments['packages']) archinstall.validate_package_list(archinstall.arguments['packages'])
invalid_packages = False break
except archinstall.RequirementError as e: except archinstall.RequirementError as e:
archinstall.log(e, fg='red') archinstall.log(e, fg='red')
invalid_packages = True archinstall.arguments['packages'] = None # Clear the packages to trigger a new input question
else:
# no additional packages were selected, which we'll allow
break
# Ask or Call the helper function that asks the user to optionally configure a network. # Ask or Call the helper function that asks the user to optionally configure a network.
if not archinstall.arguments.get('nic', None): if not archinstall.arguments.get('nic', None):