fix(installer): add warn() and fix conflict false-match for plymouth pair
Two bugs in the module-conflicts system: 1. warn() was called by the generated conflict block but never defined — any conflict would crash with 'warn: command not found'. Added warn() to helpers: dialog msgbox in interactive mode, logged printf in answerfile mode. 2. Conflict patterns used substring globs (*"id"*) which caused plymouth-custom to match the plymouth check — selecting only plymouth-custom would trigger the conflict block, call the missing warn(), and then remove plymouth-custom from SELECTED_APPS, leaving no boot splash running at all. Fixed by padding SELECTED_APPS with spaces and using *" id "* word- boundary patterns in both the condition and the removal substitution. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>main
parent
d99e323ed3
commit
b227c73fcc
|
|
@ -111,9 +111,12 @@ for i in "${ACTIVE_IDS[@]}"; do
|
||||||
IFS=',' read -ra excl_list <<< "$excl"
|
IFS=',' read -ra excl_list <<< "$excl"
|
||||||
for eid in "${excl_list[@]}"; do
|
for eid in "${excl_list[@]}"; do
|
||||||
eid="${eid#"${eid%%[![:space:]]*}"}"; eid="${eid%"${eid##*[![:space:]]}"}"
|
eid="${eid#"${eid%%[![:space:]]*}"}"; eid="${eid%"${eid##*[![:space:]]}"}"
|
||||||
gen_conflicts+="if [[ \"\$SELECTED_APPS\" == *\"${id}\"* && \"\$SELECTED_APPS\" == *\"${eid}\"* ]]; then\n"
|
gen_conflicts+="if [[ \" \$SELECTED_APPS \" == *\" ${id} \"* && \" \$SELECTED_APPS \" == *\" ${eid} \"* ]]; then\n"
|
||||||
gen_conflicts+=" warn \"${id} and ${eid} are mutually exclusive — skipping ${eid}\"\n"
|
gen_conflicts+=" warn \"'${id}' and '${eid}' are mutually exclusive — deselecting '${eid}'\"\n"
|
||||||
gen_conflicts+=" SELECTED_APPS=\"\${SELECTED_APPS/${eid}/}\"\n"
|
gen_conflicts+=" SELECTED_APPS=\" \$SELECTED_APPS \"\n"
|
||||||
|
gen_conflicts+=" SELECTED_APPS=\"\${SELECTED_APPS/ ${eid} / }\"\n"
|
||||||
|
gen_conflicts+=" SELECTED_APPS=\"\${SELECTED_APPS# }\"\n"
|
||||||
|
gen_conflicts+=" SELECTED_APPS=\"\${SELECTED_APPS% }\"\n"
|
||||||
gen_conflicts+="fi\n"
|
gen_conflicts+="fi\n"
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,18 @@ die() {
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
warn() {
|
||||||
|
# Non-fatal notice: in answerfile mode just log it; interactively show a
|
||||||
|
# dialog msgbox that blocks until the user acknowledges with OK.
|
||||||
|
if $ANSWERFILE_MODE; then
|
||||||
|
printf "\n Warning: %s\n" "$1" | tee -a "$LOG"
|
||||||
|
else
|
||||||
|
dialog --backtitle "$BACKTITLE" \
|
||||||
|
--title " Module Conflict " \
|
||||||
|
--msgbox "\n $1" 8 62
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
log_sep() {
|
log_sep() {
|
||||||
# Write a visible separator plus a timestamp to the log before each module run.
|
# Write a visible separator plus a timestamp to the log before each module run.
|
||||||
# Appended with >> so earlier log entries are never overwritten mid-install.
|
# Appended with >> so earlier log entries are never overwritten mid-install.
|
||||||
|
|
@ -683,13 +695,19 @@ fi
|
||||||
# module script will be caught by run_module()'s error handling rather than
|
# module script will be caught by run_module()'s error handling rather than
|
||||||
# silently skipped — 'bash "$script"' will exit non-zero if the file is absent.
|
# silently skipped — 'bash "$script"' will exit non-zero if the file is absent.
|
||||||
# BEGIN GENERATED MODULES: module-conflicts
|
# BEGIN GENERATED MODULES: module-conflicts
|
||||||
if [[ "$SELECTED_APPS" == *"plymouth"* && "$SELECTED_APPS" == *"plymouth-custom"* ]]; then
|
if [[ " $SELECTED_APPS " == *" plymouth "* && " $SELECTED_APPS " == *" plymouth-custom "* ]]; then
|
||||||
warn "plymouth and plymouth-custom are mutually exclusive — skipping plymouth-custom"
|
warn "'plymouth' and 'plymouth-custom' are mutually exclusive — deselecting 'plymouth-custom'"
|
||||||
SELECTED_APPS="${SELECTED_APPS/plymouth-custom/}"
|
SELECTED_APPS=" $SELECTED_APPS "
|
||||||
|
SELECTED_APPS="${SELECTED_APPS/ plymouth-custom / }"
|
||||||
|
SELECTED_APPS="${SELECTED_APPS# }"
|
||||||
|
SELECTED_APPS="${SELECTED_APPS% }"
|
||||||
fi
|
fi
|
||||||
if [[ "$SELECTED_APPS" == *"plymouth-custom"* && "$SELECTED_APPS" == *"plymouth"* ]]; then
|
if [[ " $SELECTED_APPS " == *" plymouth-custom "* && " $SELECTED_APPS " == *" plymouth "* ]]; then
|
||||||
warn "plymouth-custom and plymouth are mutually exclusive — skipping plymouth"
|
warn "'plymouth-custom' and 'plymouth' are mutually exclusive — deselecting 'plymouth'"
|
||||||
SELECTED_APPS="${SELECTED_APPS/plymouth/}"
|
SELECTED_APPS=" $SELECTED_APPS "
|
||||||
|
SELECTED_APPS="${SELECTED_APPS/ plymouth / }"
|
||||||
|
SELECTED_APPS="${SELECTED_APPS# }"
|
||||||
|
SELECTED_APPS="${SELECTED_APPS% }"
|
||||||
fi
|
fi
|
||||||
# END GENERATED MODULES: module-conflicts
|
# END GENERATED MODULES: module-conflicts
|
||||||
# BEGIN GENERATED MODULES: module-dispatch
|
# BEGIN GENERATED MODULES: module-dispatch
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue