Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/profiles/server.py
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2022-05-28 10:36:38 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2022-05-28 10:36:38 +0200
commitfaf925de1882be722d2994d697a802918282e509 (patch)
tree4856c76b10b36e94875ce3c9add961960bb23bf0 /profiles/server.py
parent3801bee921d22e23435c781c469d9ec0adfa00bd (diff)
parent78449f75bc44f0e2b03cb9d909b9b78e4f7ca4c8 (diff)
Merge branch 'upstreamMaster'
Diffstat (limited to 'profiles/server.py')
-rw-r--r--profiles/server.py28
1 files changed, 20 insertions, 8 deletions
diff --git a/profiles/server.py b/profiles/server.py
index c4f35f7b..21681c2f 100644
--- a/profiles/server.py
+++ b/profiles/server.py
@@ -1,12 +1,18 @@
# Used to select various server application profiles on top of a minimal installation.
import logging
+from typing import Any, TYPE_CHECKING
import archinstall
+from archinstall import Menu
+from archinstall.lib.menu.menu import MenuSelectionType
+
+if TYPE_CHECKING:
+ _: Any
is_top_level_profile = True
-__description__ = 'Provides a selection of various server packages to install and enable, e.g. httpd, nginx, mariadb'
+__description__ = str(_('Provides a selection of various server packages to install and enable, e.g. httpd, nginx, mariadb'))
available_servers = [
"cockpit",
@@ -26,15 +32,21 @@ def _prep_function(*args, **kwargs):
Magic function called by the importing installer
before continuing any further.
"""
- if not archinstall.storage.get('_selected_servers', None):
- servers = archinstall.Menu(
- 'Choose which servers to install, if none then a minimal installation wil be done', available_servers,
- multi=True
- ).run()
+ choice = Menu(str(_(
+ 'Choose which servers to install, if none then a minimal installation wil be done')),
+ available_servers,
+ preset_values=kwargs['servers'],
+ multi=True
+ ).run()
+
+ if choice.type_ != MenuSelectionType.Selection:
+ return False
- archinstall.storage['_selected_servers'] = servers
+ if choice.value:
+ archinstall.storage['_selected_servers'] = choice.value
+ return True
- return True
+ return False
if __name__ == 'server':