From b227c73fccc2b0b7623aabde7e1e5362e849a785 Mon Sep 17 00:00:00 2001 From: The_miro Date: Fri, 26 Jun 2026 13:57:51 +0200 Subject: [PATCH] fix(installer): add warn() and fix conflict false-match for plymouth pair MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- setup/tools/generate-modules.sh | 9 ++++++--- setup/tui-install.sh | 30 ++++++++++++++++++++++++------ 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/setup/tools/generate-modules.sh b/setup/tools/generate-modules.sh index 7404a69..cbdb2c3 100755 --- a/setup/tools/generate-modules.sh +++ b/setup/tools/generate-modules.sh @@ -111,9 +111,12 @@ for i in "${ACTIVE_IDS[@]}"; do IFS=',' read -ra excl_list <<< "$excl" for eid in "${excl_list[@]}"; do eid="${eid#"${eid%%[![:space:]]*}"}"; eid="${eid%"${eid##*[![:space:]]}"}" - 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+=" SELECTED_APPS=\"\${SELECTED_APPS/${eid}/}\"\n" + gen_conflicts+="if [[ \" \$SELECTED_APPS \" == *\" ${id} \"* && \" \$SELECTED_APPS \" == *\" ${eid} \"* ]]; then\n" + gen_conflicts+=" warn \"'${id}' and '${eid}' are mutually exclusive — deselecting '${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" done done diff --git a/setup/tui-install.sh b/setup/tui-install.sh index f1314df..6b931fa 100755 --- a/setup/tui-install.sh +++ b/setup/tui-install.sh @@ -105,6 +105,18 @@ die() { 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() { # 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. @@ -683,13 +695,19 @@ fi # 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. # BEGIN GENERATED MODULES: module-conflicts -if [[ "$SELECTED_APPS" == *"plymouth"* && "$SELECTED_APPS" == *"plymouth-custom"* ]]; then - warn "plymouth and plymouth-custom are mutually exclusive — skipping plymouth-custom" - SELECTED_APPS="${SELECTED_APPS/plymouth-custom/}" +if [[ " $SELECTED_APPS " == *" plymouth "* && " $SELECTED_APPS " == *" plymouth-custom "* ]]; then + warn "'plymouth' and 'plymouth-custom' are mutually exclusive — deselecting 'plymouth-custom'" + SELECTED_APPS=" $SELECTED_APPS " + SELECTED_APPS="${SELECTED_APPS/ plymouth-custom / }" + SELECTED_APPS="${SELECTED_APPS# }" + SELECTED_APPS="${SELECTED_APPS% }" fi -if [[ "$SELECTED_APPS" == *"plymouth-custom"* && "$SELECTED_APPS" == *"plymouth"* ]]; then - warn "plymouth-custom and plymouth are mutually exclusive — skipping plymouth" - SELECTED_APPS="${SELECTED_APPS/plymouth/}" +if [[ " $SELECTED_APPS " == *" plymouth-custom "* && " $SELECTED_APPS " == *" plymouth "* ]]; then + warn "'plymouth-custom' and 'plymouth' are mutually exclusive — deselecting 'plymouth'" + SELECTED_APPS=" $SELECTED_APPS " + SELECTED_APPS="${SELECTED_APPS/ plymouth / }" + SELECTED_APPS="${SELECTED_APPS# }" + SELECTED_APPS="${SELECTED_APPS% }" fi # END GENERATED MODULES: module-conflicts # BEGIN GENERATED MODULES: module-dispatch