fix: sub-options are skipped when their parent failed

This commit is contained in:
theupriser committed 2026-10-13 19:05:56 +02:00
1 parent 3ebb8d3bc9
commit a73d302869
3 files changed
+12

No files matched your search

+5
View File
@@ -185,6 +185,11 @@ backend_apply() {
if backend_run_component "$c" disable; then feature_record "$c" disable; else failed+=("$c"); fi
done
for c in "${TO_ENABLE[@]}"; do
# A sub-option of something that just failed isn't applied: it would be left on without its parent.
if [[ -n "${PARENT[$c]:-}" && " ${failed[*]:-} " == *" ${PARENT[$c]} "* ]]; then
warn "Skipping ${LABEL[$c]%%:*}: ${LABEL[${PARENT[$c]}]%%:*} didn't work."
continue
fi
if backend_run_component "$c" enable; then is_action "$c" || feature_record "$c" enable; else failed+=("$c"); fi
done
feature_record_unticked
+5
View File
@@ -511,6 +511,11 @@ apply_changes() {
if "${c}_disable"; then feature_record "$c" disable; else failed+=("$c"); fi
done
for c in "${TO_ENABLE[@]}"; do
# A sub-option of something that just failed isn't applied: it would be left on without its parent.
if [[ -n "${PARENT[$c]:-}" && " ${failed[*]:-} " == *" ${PARENT[$c]} "* ]]; then
warn "Skipping ${LABEL[$c]%%:*}: ${LABEL[${PARENT[$c]}]%%:*} didn't work."
continue
fi
if [[ "$c" == boot ]]; then echo; echo -e "${c_bold}Boot into: desktop${c_reset}"
elif is_action "$c"; then echo; echo -e "${c_bold}Running: ${LABEL[$c]%%:*}${c_reset}"
else echo; echo -e "${c_bold}Turning on: ${LABEL[$c]}${c_reset}"; fi