Package sections: always-on + advanced menu #3

Merged
yuri merged 2 commits from feat/package-sections into main 2026-10-27 13:57:40 +01:00
Showing only changes of commit af4504fdbe - Show all commits
+20 -5
View File
@@ -503,14 +503,26 @@ run_advanced_menu() {
if (( pick < 1 || pick > n )); then err "Ignoring out-of-range pick: $pick"; continue; fi if (( pick < 1 || pick > n )); then err "Ignoring out-of-range pick: $pick"; continue; fi
entry="${entries[$((pick-1))]}" entry="${entries[$((pick-1))]}"
rest="${entry#*:}"; rest="${rest#*:}" # drop id and label -> packages rest="${entry#*:}"; rest="${rest#*:}" # drop id and label -> packages
to_install+=("$rest") # word-split into SEPARATE packages: quoting $rest whole makes dnf
# look for one package named "qemu-kvm libvirt ..." (seen on the VM)
# shellcheck disable=SC2206
to_install+=(${rest})
done done
if (( ${#to_install[@]} > 0 )); then if (( ${#to_install[@]} > 0 )); then
step "Installing from $cat: ${to_install[*]}" step "Installing from $cat: ${to_install[*]}"
# Repos for items that need one are handled in install_optional_pkgs below. # install_category_pkgs wires any needed third-party repo first.
install_category_pkgs "$cat" "${to_install[@]}" # Failure must NOT kill the script: warn in red and drop back to
done_any=true # the menu (set -e is bypassed for this one call).
if install_category_pkgs "$cat" "${to_install[@]}"; then
done_any=true
else
color_red " Installation failed: ${to_install[*]}"
color_red " (dnf reported no match / transaction failure — see output above)"
warn " Returning to the menu. The system is unchanged."
pause_if_debug
fi
unset to_install; local -a to_install=() # fresh slate for next pick
fi fi
done done
$done_any && ok "Optional tools installed." $done_any && ok "Optional tools installed."
@@ -542,7 +554,10 @@ install_category_pkgs() {
fi fi
;; ;;
esac esac
install_packages "$@" # Resilient install: report failure but return non-zero instead of
# aborting under set -e; the caller turns it into a red warning.
install_packages "$@" || return 1
return 0
} }
# Interactive only: an unattended --yes run must not hang on this menu. # Interactive only: an unattended --yes run must not hang on this menu.