Skip to content

Commit 51b1c15

Browse files
author
Christian Schmidt
committed
Make the show_*_partitions function look better by reordering
Especially with logical volume paths, the available space was not enough. Move the flags to the front so the (very variable length) paths come last.
1 parent cfbcae4 commit 51b1c15

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

buildkernel

+13-12
Original file line numberDiff line numberDiff line change
@@ -902,15 +902,15 @@ show_gpg_keyfile_partitions() {
902902
if ((NUMGPGPARTS==0)); then
903903
show "No potential keyfile partitions found on your machine"
904904
else
905-
printf "%3s %-36s %-10s %-3s %3s\n" "Num" "Partition UUID" "Path" "Use"
906-
printf "%s\n" "--- ------------------------------------ ---------- ---"
905+
echo "Num Use UUID Path"
906+
echo "--- --- ------------------------------------ -------------------------------"
907907
for I in "${!GPGUUIDS[@]}"; do
908908
local INUSE="[ ]"
909909
if [[ ${KEYFILEPARTUUID:-""} == "${GPGUUIDS[$I]}" ]]; then
910910
INUSE="[*]"
911911
fi
912-
printf "%2d) %-36s %-10s %3s\n" $((I+1)) "${GPGUUIDS[$I]}" \
913-
"${ALLUUIDS[${GPGUUIDS[$I]}]}" "${INUSE}"
912+
printf "%2d) %3s %-36s %-10s\n" $((I+1)) \
913+
"${INUSE}" "${GPGUUIDS[$I]}" "${ALLUUIDS[${GPGUUIDS[$I]}]}"
914914
done
915915
fi
916916
if [ -n "${LASTITEM}" ]; then
@@ -923,8 +923,8 @@ show_luks_partitions() {
923923
if ((NUMLUKSPARTS==0)); then
924924
die "No LUKS partitions found on your machine"
925925
else
926-
printf "%3s %-36s %-10s %-3s %3s\n" "Num" "Partition UUID" "Path" "USB" "Use"
927-
printf "%s\n" "--- ------------------------------------ ---------- --- ---"
926+
echo "Num USB Use UUID Path"
927+
echo "--- --- --- ------------------------------------ -------------------------------"
928928
for I in "${!LUKSUUIDS[@]}"; do
929929
local ISUSB=" N "
930930
local INUSE="[ ]"
@@ -935,8 +935,8 @@ show_luks_partitions() {
935935
if [[ ${CRYPTPARTUUID:-""} == "${LUKSUUIDS[$I]}" ]]; then
936936
INUSE="[*]"
937937
fi
938-
printf "%2d) %-36s %-10s %-3s %3s\n" $((I+1)) "${LUKSUUIDS[$I]}" \
939-
"${DEVNAME}" "${ISUSB}" "${INUSE}"
938+
printf "%2d) %3s %3s %-36s %-10s\n" $((I+1)) \
939+
"${ISUSB}" "${INUSE}" "${LUKSUUIDS[$I]}" "${DEVNAME}"
940940
done
941941
fi
942942
if [ -n "${LASTITEM}" ]; then
@@ -950,8 +950,8 @@ show_efi_system_partitions() {
950950
if ((NUMEFIPARTS==0)); then
951951
die "No EFI system partitions found on your machine"
952952
else
953-
printf "%3s %-36s %-10s %-3s %-3s %3s\n" "Num" "Partition UUID" "Path" "USB" "Win" "Use"
954-
printf "%s\n" "--- ------------------------------------ ---------- --- --- ---"
953+
echo "Num USB Win Use UUID Path"
954+
echo "--- --- --- --- ------------------------------------ -------------------------------"
955955
for I in "${!EFIUUIDS[@]}"; do
956956
local ISUSB=" N "
957957
local INUSE="[ ]"
@@ -968,8 +968,8 @@ show_efi_system_partitions() {
968968
elif [[ "${HASWINBOOTLOADER[${EFIUUIDS[$I]}]-0}" == "1" ]]; then
969969
ISWIN=" Y "
970970
fi
971-
printf "%2d) %-36s %-10s %-3s %-3s %3s\n" $((I+1)) "${EFIUUIDS[$I]}" \
972-
"${DEVNAME}" "${ISUSB}" "${ISWIN}" "${INUSE}"
971+
printf "%2d) %3s %3s %3s %-36s %-30s\n" $((I+1)) \
972+
"${ISUSB}" "${ISWIN}" "${INUSE}" "${EFIUUIDS[$I]}" "${DEVNAME}"
973973
done
974974
fi
975975
if [ -n "${LASTITEM}" ]; then
@@ -2222,6 +2222,7 @@ handle_final_options() {
22222222
suppress_colour_and_alert_if_output_not_to_a_terminal
22232223
check_if_booted_under_efi
22242224
load_all_devices
2225+
22252226
source_etc_conf_file
22262227
process_command_line_options "${@}"
22272228
setup_build_directory

0 commit comments

Comments
 (0)