Add filtration on top level profile
This commit is contained in:
parent
ac7d980f89
commit
f85fb66bc6
|
|
@ -177,6 +177,7 @@ class Profile(Script):
|
||||||
if hasattr(imported, '_prep_function'):
|
if hasattr(imported, '_prep_function'):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def has_post_install(self):
|
def has_post_install(self):
|
||||||
with open(self.path, 'r') as source:
|
with open(self.path, 'r') as source:
|
||||||
source_data = source.read()
|
source_data = source.read()
|
||||||
|
|
@ -193,6 +194,13 @@ class Profile(Script):
|
||||||
if hasattr(imported, '_post_install'):
|
if hasattr(imported, '_post_install'):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def is_top_level_profile(self):
|
||||||
|
with open(self.path, 'r') as source:
|
||||||
|
source_data = source.read()
|
||||||
|
|
||||||
|
# TODO: I imagine that there is probably a better way to write this.
|
||||||
|
return 'top_level_profile = True' in source_data
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def packages(self) -> list:
|
def packages(self) -> list:
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import getpass, time, json, sys, signal, os
|
import getpass, time, json, sys, signal, os
|
||||||
import archinstall
|
import archinstall
|
||||||
from archinstall.lib.hardware import hasUEFI
|
from archinstall.lib.hardware import hasUEFI
|
||||||
|
from archinstall.lib.profiles import Profile
|
||||||
|
|
||||||
"""
|
"""
|
||||||
This signal-handler chain (and global variable)
|
This signal-handler chain (and global variable)
|
||||||
|
|
@ -167,7 +168,7 @@ def ask_user_questions():
|
||||||
|
|
||||||
# Ask for archinstall-specific profiles (such as desktop environments etc)
|
# Ask for archinstall-specific profiles (such as desktop environments etc)
|
||||||
if not archinstall.arguments.get('profile', None):
|
if not archinstall.arguments.get('profile', None):
|
||||||
archinstall.arguments['profile'] = archinstall.select_profile(archinstall.list_profiles())
|
archinstall.arguments['profile'] = archinstall.select_profile(filter(lambda profile: (Profile(None, profile).is_top_level_profile()), archinstall.list_profiles()))
|
||||||
else:
|
else:
|
||||||
archinstall.arguments['profile'] = archinstall.list_profiles()[archinstall.arguments['profile']]
|
archinstall.arguments['profile'] = archinstall.list_profiles()[archinstall.arguments['profile']]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue