Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds@gmail.com>2021-02-17 13:54:34 +0100
committerAnton Hvornum <anton.feeds@gmail.com>2021-02-17 13:54:34 +0100
commit03a69eba2e882e430fc9c668c9d334e8818a63c3 (patch)
tree1066d31d951b625620b5cc4f8c01ee4aff3513da /examples
parent572d59e5607811c4f7456d09ad1744b2da3ea394 (diff)
Cleaned up guided.py further by stream-lining the profiles and NIC configuration.
Diffstat (limited to 'examples')
-rw-r--r--examples/guided.py34
1 files changed, 13 insertions, 21 deletions
diff --git a/examples/guided.py b/examples/guided.py
index 119f22b3..3226c69b 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -180,27 +180,19 @@ archinstall.arguments['superusers'] = {**archinstall.arguments['superusers'], **
# Ask for archinstall-specific profiles (such as desktop environments etc)
if not archinstall.arguments.get('profile', None):
- while 1:
- profile = archinstall.select_profile(archinstall.list_profiles())
- print(profile)
- if profile:
- archinstall.storage['_guided']['profile'] = profile
-
- if type(profile) != str: # Got a imported profile
- archinstall.storage['_guided']['profile'] = profile[0] # The second return is a module, and not a handle/object.
- if not profile[1]._prep_function():
- # TODO: See how we can incorporate this into
- # the general log flow. As this is pre-installation
- # session setup. Which creates the installation.log file.
- archinstall.log(
- ' * Profile\'s preparation requirements was not fulfilled.',
- bg='black',
- fg='red'
- )
- continue
- break
- else:
- break
+ archinstall.arguments['profile'] = archinstall.select_profile(archinstall.list_profiles())
+else:
+ archinstall.arguments['profile'] = archinstall.list_profiles()[archinstall.arguments['profile']]
+
+# Check the potentially selected profiles preperations to get early checks if some additional questions are needed.
+if archinstall.arguments['profile']:
+ if not archinstall.arguments['profile']._prep_function():
+ archinstall.log(
+ ' * Profile\'s preparation requirements was not fulfilled.',
+ bg='black',
+ fg='red'
+ )
+ exit(1)
# Additional packages (with some light weight error handling for invalid package names)
if not archinstall.arguments.get('packages', None):