From 81c57560b3f2f0cd10dd8d6b360266f9f4622a41 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Thu, 22 Apr 2021 21:56:52 +0200 Subject: Fixes #324. --- examples/guided.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/guided.py b/examples/guided.py index ef447abb..09638f0e 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -74,13 +74,14 @@ def ask_user_questions(): archinstall.log(f" ** You will now select which partitions to use by selecting mount points (inside the installation). **") archinstall.log(f" ** The root would be a simple / and the boot partition /boot (as all paths are relative inside the installation). **") + mountpoints_set = [] while True: # Select a partition # If we provide keys as options, it's better to convert them to list and sort before passing mountpoints_list = sorted(list(partition_mountpoints.keys())) partition = archinstall.generic_select(mountpoints_list, "Select a partition by number that you want to set a mount-point for (leave blank when done): ") - if not partition: + if not partition and set(mountpoints_set) & {'/', '/boot'} == {'/', '/boot'}: break # Select a mount-point @@ -122,6 +123,7 @@ def ask_user_questions(): # We can safely mark the partition for formatting and where to mount it. # TODO: allow_formatting might be redundant since target_mountpoint should only be # set if we actually want to format it anyway. + mountpoints_set.append(mountpoint) partition.allow_formatting = True partition.target_mountpoint = mountpoint # Only overwrite the filesystem definition if we selected one: -- cgit v1.2.3-54-g00ecf From 3cf8ec7ad6eccd2899ded1f80ae31c2f835c4d8f Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Thu, 22 Apr 2021 21:58:47 +0200 Subject: Added a continuation if partitions are not set yet. --- examples/guided.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/guided.py b/examples/guided.py index 09638f0e..2bf911fc 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -81,8 +81,11 @@ def ask_user_questions(): mountpoints_list = sorted(list(partition_mountpoints.keys())) partition = archinstall.generic_select(mountpoints_list, "Select a partition by number that you want to set a mount-point for (leave blank when done): ") - if not partition and set(mountpoints_set) & {'/', '/boot'} == {'/', '/boot'}: - break + if not partition: + if set(mountpoints_set) & {'/', '/boot'} == {'/', '/boot'}: + break + + continue # Select a mount-point mountpoint = input(f"Enter a mount-point for {partition}: ").strip(' ') -- cgit v1.2.3-54-g00ecf