Switch from flags to an 'additional repository' menu (#977)
* Add multilib flag to enable this repository and enable multi-lib testing if testing flag is also passed * Fix comments * Attempt to force pacman to use the config file from the host * Make sure the pacman configuration is copied to target * flake8 * Call enable on additional-repositories * Add method to select additional repositories * Add menu option for additional repos * This is a bit cleaner than having it all on one line * Add import * Use [] as default instead of None * Use empty array for default option here * Try this to ensure a valid array is returned on skipping * Add additional-repositories to schema * Missed changing this comment earlier
This commit is contained in:
parent
67b922002a
commit
d9118a33b3
|
|
@ -32,6 +32,7 @@ from ..user_interaction import select_encrypted_partitions
|
||||||
from ..user_interaction import select_harddrives
|
from ..user_interaction import select_harddrives
|
||||||
from ..user_interaction import select_profile
|
from ..user_interaction import select_profile
|
||||||
from ..user_interaction import select_archinstall_language
|
from ..user_interaction import select_archinstall_language
|
||||||
|
from ..user_interaction import select_additional_repositories
|
||||||
from ..translation import Translation
|
from ..translation import Translation
|
||||||
|
|
||||||
class Selector:
|
class Selector:
|
||||||
|
|
@ -498,6 +499,11 @@ class GlobalMenu(GeneralMenu):
|
||||||
_('Additional packages to install'),
|
_('Additional packages to install'),
|
||||||
lambda: ask_additional_packages_to_install(storage['arguments'].get('packages', None)),
|
lambda: ask_additional_packages_to_install(storage['arguments'].get('packages', None)),
|
||||||
default=[])
|
default=[])
|
||||||
|
self._menu_options['additional-repositories'] = \
|
||||||
|
Selector(
|
||||||
|
_('Additional repositories to enable'),
|
||||||
|
lambda: select_additional_repositories(),
|
||||||
|
default=[])
|
||||||
self._menu_options['nic'] = \
|
self._menu_options['nic'] = \
|
||||||
Selector(
|
Selector(
|
||||||
_('Configure network'),
|
_('Configure network'),
|
||||||
|
|
|
||||||
|
|
@ -966,6 +966,28 @@ def select_kernel() -> List[str]:
|
||||||
).run()
|
).run()
|
||||||
return selected_kernels
|
return selected_kernels
|
||||||
|
|
||||||
|
def select_additional_repositories() -> List[str]:
|
||||||
|
"""
|
||||||
|
Allows the user to select additional repositories (multilib, and testing) if desired.
|
||||||
|
|
||||||
|
:return: The string as a selected repository
|
||||||
|
:rtype: string
|
||||||
|
"""
|
||||||
|
|
||||||
|
repositories = ["multilib", "testing"]
|
||||||
|
|
||||||
|
additional_repositories = Menu(
|
||||||
|
_('Choose which optional additional repositories to enable'),
|
||||||
|
repositories,
|
||||||
|
sort=False,
|
||||||
|
multi=True,
|
||||||
|
default_option=[]
|
||||||
|
).run()
|
||||||
|
|
||||||
|
if additional_repositories is not None:
|
||||||
|
return additional_repositories
|
||||||
|
|
||||||
|
return []
|
||||||
|
|
||||||
def select_locale_lang(default):
|
def select_locale_lang(default):
|
||||||
locales = list_locales()
|
locales = list_locales()
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,8 @@ def ask_user_questions():
|
||||||
|
|
||||||
global_menu.enable('ntp')
|
global_menu.enable('ntp')
|
||||||
|
|
||||||
|
global_menu.enable('additional-repositories')
|
||||||
|
|
||||||
global_menu.run()
|
global_menu.run()
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -143,8 +145,12 @@ def perform_installation(mountpoint):
|
||||||
# Set mirrors used by pacstrap (outside of installation)
|
# Set mirrors used by pacstrap (outside of installation)
|
||||||
if archinstall.arguments.get('mirror-region', None):
|
if archinstall.arguments.get('mirror-region', None):
|
||||||
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(testing=archinstall.arguments.get('testing', False), multilib=archinstall.arguments.get('multilib', False)):
|
# Retrieve list of additional repositories and set boolean values appropriately
|
||||||
|
enable_testing = 'testing' in archinstall.arguments.get('additional-repositories', None)
|
||||||
|
enable_multilib = 'multilib' in archinstall.arguments.get('additional-repositories', None)
|
||||||
|
|
||||||
|
if installation.minimal_installation(testing=enable_testing, multilib=enable_multilib):
|
||||||
installation.set_locale(archinstall.arguments['sys-language'], archinstall.arguments['sys-encoding'].upper())
|
installation.set_locale(archinstall.arguments['sys-language'], archinstall.arguments['sys-encoding'].upper())
|
||||||
installation.set_hostname(archinstall.arguments['hostname'])
|
installation.set_hostname(archinstall.arguments['hostname'])
|
||||||
if archinstall.arguments['mirror-region'].get("mirrors", None) is not None:
|
if archinstall.arguments['mirror-region'].get("mirrors", None) is not None:
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,14 @@
|
||||||
"description": "A schema for the archinstall command config, more info over at https://archinstall.readthedocs.io/installing/guided.html#options-for-config",
|
"description": "A schema for the archinstall command config, more info over at https://archinstall.readthedocs.io/installing/guided.html#options-for-config",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"additional-repositories": {
|
||||||
|
"description": "Additional repositories to optionally enable",
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"multilib",
|
||||||
|
"testing"
|
||||||
|
]
|
||||||
|
},
|
||||||
"audio": {
|
"audio": {
|
||||||
"description": "Audio server to be installed",
|
"description": "Audio server to be installed",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue