fixed issues raised in a review
This commit is contained in:
parent
37fae92253
commit
3347d04bfa
|
|
@ -345,6 +345,7 @@ def select_language(options, show_only_country_codes=True):
|
||||||
|
|
||||||
elif selected_language.isdigit() and (pos := int(selected_language)) <= len(languages)-1:
|
elif selected_language.isdigit() and (pos := int(selected_language)) <= len(languages)-1:
|
||||||
selected_language = languages[pos]
|
selected_language = languages[pos]
|
||||||
|
return select_language
|
||||||
# I'm leaving "options" on purpose here.
|
# I'm leaving "options" on purpose here.
|
||||||
# Since languages possibly contains a filtered version of
|
# Since languages possibly contains a filtered version of
|
||||||
# all possible language layouts, and we might want to write
|
# all possible language layouts, and we might want to write
|
||||||
|
|
@ -352,9 +353,9 @@ def select_language(options, show_only_country_codes=True):
|
||||||
# go through the search step.
|
# go through the search step.
|
||||||
elif selected_language in options:
|
elif selected_language in options:
|
||||||
selected_language = options[options.index(selected_language)]
|
selected_language = options[options.index(selected_language)]
|
||||||
|
return selected_language
|
||||||
else:
|
else:
|
||||||
RequirementError("Selected language does not exist.")
|
print("Invalid Langue please select a valid option.")
|
||||||
return selected_language
|
|
||||||
|
|
||||||
raise RequirementError("Selecting languages require a least one language to be given as an option.")
|
raise RequirementError("Selecting languages require a least one language to be given as an option.")
|
||||||
|
|
||||||
|
|
@ -383,21 +384,19 @@ def select_mirror_regions(mirrors, show_top_mirrors=True):
|
||||||
print(' -- You can skip this step by leaving the option blank --')
|
print(' -- You can skip this step by leaving the option blank --')
|
||||||
selected_mirror = input('Select one of the above regions to download packages from (by number or full name): ')
|
selected_mirror = input('Select one of the above regions to download packages from (by number or full name): ')
|
||||||
if len(selected_mirror.strip()) == 0:
|
if len(selected_mirror.strip()) == 0:
|
||||||
return {}
|
return {"mirror": None}
|
||||||
|
|
||||||
elif selected_mirror.isdigit() and (pos := int(selected_mirror)) <= len(regions)-1:
|
elif selected_mirror.isdigit() and int(selected_mirror) <= len(regions)-1:
|
||||||
|
# I'm leaving "mirrors" on purpose here.
|
||||||
|
# Since region possibly contains a known region of
|
||||||
|
# all possible regions, and we might want to write
|
||||||
|
# for instance Sweden (if we know that exists) without having to
|
||||||
|
# go through the search step.
|
||||||
region = regions[int(selected_mirror)]
|
region = regions[int(selected_mirror)]
|
||||||
selected_mirrors[region] = mirrors[region]
|
selected_mirrors[region] = mirrors[region]
|
||||||
# I'm leaving "mirrors" on purpose here.
|
|
||||||
# Since region possibly contains a known region of
|
|
||||||
# all possible regions, and we might want to write
|
|
||||||
# for instance Sweden (if we know that exists) without having to
|
|
||||||
# go through the search step.
|
|
||||||
elif selected_mirror in mirrors:
|
elif selected_mirror in mirrors:
|
||||||
selected_mirrors[selected_mirror] = mirrors[selected_mirror]
|
selected_mirrors[selected_mirror] = mirrors[selected_mirror]
|
||||||
else:
|
else:
|
||||||
RequirementError("Selected region does not exist.")
|
print("Selected region does not exist.")
|
||||||
|
|
||||||
return selected_mirrors
|
return selected_mirrors
|
||||||
|
|
||||||
raise RequirementError("Selecting mirror region require a least one region to be given as an option.")
|
|
||||||
|
|
@ -23,7 +23,8 @@ def ask_user_questions():
|
||||||
|
|
||||||
# Set which region to download packages from during the installation
|
# Set which region to download packages from during the installation
|
||||||
if not archinstall.arguments.get('mirror-region', None):
|
if not archinstall.arguments.get('mirror-region', None):
|
||||||
archinstall.arguments['mirror-region'] = archinstall.select_mirror_regions(archinstall.list_mirrors())
|
while archinstall.arguments.get("mirror-region",{}) == {}:
|
||||||
|
archinstall.arguments['mirror-region'] = archinstall.select_mirror_regions(archinstall.list_mirrors())
|
||||||
else:
|
else:
|
||||||
selected_region = archinstall.arguments['mirror-region']
|
selected_region = archinstall.arguments['mirror-region']
|
||||||
archinstall.arguments['mirror-region'] = {selected_region : archinstall.list_mirrors()[selected_region]}
|
archinstall.arguments['mirror-region'] = {selected_region : archinstall.list_mirrors()[selected_region]}
|
||||||
|
|
@ -184,13 +185,16 @@ def ask_user_questions():
|
||||||
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']):
|
||||||
# Verify packages that were given
|
invalid_packages = True
|
||||||
try:
|
while invalid_packages == True:
|
||||||
archinstall.log(f"Verifying that additional packages exist (this might take a few seconds)")
|
# Verify packages that were given
|
||||||
archinstall.validate_package_list(archinstall.arguments['packages'])
|
try:
|
||||||
except archinstall.RequirementError as e:
|
archinstall.log(f"Verifying that additional packages exist (this might take a few seconds)")
|
||||||
archinstall.log(e, fg='red')
|
archinstall.validate_package_list(archinstall.arguments['packages'])
|
||||||
exit(1)
|
invalid_packages = False
|
||||||
|
except archinstall.RequirementError as e:
|
||||||
|
archinstall.log(e, fg='red')
|
||||||
|
invalid_packages = True
|
||||||
|
|
||||||
# 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):
|
||||||
|
|
@ -284,7 +288,8 @@ def perform_installation(mountpoint):
|
||||||
archinstall.use_mirrors(archinstall.arguments['mirror-region']) # Set the mirrors for the live medium
|
archinstall.use_mirrors(archinstall.arguments['mirror-region']) # Set the mirrors for the live medium
|
||||||
if installation.minimal_installation():
|
if installation.minimal_installation():
|
||||||
installation.set_hostname(archinstall.arguments['hostname'])
|
installation.set_hostname(archinstall.arguments['hostname'])
|
||||||
installation.set_mirrors(archinstall.arguments['mirror-region']) # Set the mirrors in the installation medium
|
if archinstall.arguments['mirror-region'] != None:
|
||||||
|
installation.set_mirrors(archinstall.arguments['mirror-region']) # Set the mirrors in the installation medium
|
||||||
installation.set_keyboard_language(archinstall.arguments['keyboard-language'])
|
installation.set_keyboard_language(archinstall.arguments['keyboard-language'])
|
||||||
installation.add_bootloader()
|
installation.add_bootloader()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue