Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/profiles.py
diff options
context:
space:
mode:
Diffstat (limited to 'archinstall/lib/profiles.py')
-rw-r--r--archinstall/lib/profiles.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/archinstall/lib/profiles.py b/archinstall/lib/profiles.py
index 8434a0ab..ebb08990 100644
--- a/archinstall/lib/profiles.py
+++ b/archinstall/lib/profiles.py
@@ -23,6 +23,23 @@ def grab_url_data(path):
return response.read()
+def is_desktop_profile(profile) -> bool:
+ if str(profile) == 'Profile(desktop)':
+ return True
+
+ desktop_profile = Profile(None, "desktop")
+ with open(desktop_profile.path, 'r') as source:
+ source_data = source.read()
+
+ if '__name__' in source_data and '__supported__' in source_data:
+ with desktop_profile.load_instructions(namespace=f"{desktop_profile.namespace}.py") as imported:
+ if hasattr(imported, '__supported__'):
+ desktop_profiles = imported.__supported__
+ return str(profile) in [f"Profile({s})" for s in desktop_profiles]
+
+ return False
+
+
def list_profiles(filter_irrelevant_macs=True, subpath='', filter_top_level_profiles=False):
# TODO: Grab from github page as well, not just local static files
if filter_irrelevant_macs: