Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ea50f64ef2 | ||
|
|
82b35e4bdb |
@@ -442,38 +442,34 @@ run_advanced_menu() {
|
|||||||
sel=$(ui_choose_multi "$cat" "Install which? (multi-select, none = back):" "${labels[@]}")
|
sel=$(ui_choose_multi "$cat" "Install which? (multi-select, none = back):" "${labels[@]}")
|
||||||
[[ -z "$sel" ]] && continue
|
[[ -z "$sel" ]] && continue
|
||||||
|
|
||||||
# Map chosen labels back to their package lists. Word-split each
|
# Resolve each picked label to its OWN package list, then install
|
||||||
# package list into SEPARATE args: quoting it whole makes dnf look for
|
# PER ITEM: one failing package used to kill the whole multi-select
|
||||||
# one package named "qemu-kvm libvirt ..." (seen on the VM).
|
# transaction (VM: brave's no-match took chromium down with it).
|
||||||
local -a to_install=()
|
# Repo wiring inside install_category_pkgs runs per item; failures
|
||||||
|
# warn in red and the remaining picks still install.
|
||||||
|
local picked lbl it
|
||||||
while IFS= read -r picked; do
|
while IFS= read -r picked; do
|
||||||
[[ -z "$picked" ]] && continue
|
[[ -z "$picked" ]] && continue
|
||||||
for entry in "${entries[@]}"; do
|
for entry in "${entries[@]}"; do
|
||||||
rest="${entry#*:}"
|
rest="${entry#*:}"
|
||||||
lbl="${rest%%:*}"
|
lbl="${rest%%:*}"
|
||||||
if [[ "$lbl" == "$picked" ]]; then
|
[[ "$lbl" == "$picked" ]] || continue
|
||||||
rest="${entry#*:}"; rest="${rest#*:}" # drop id and label
|
rest="${rest#*:}" # drop id and label -> pkgs
|
||||||
# shellcheck disable=SC2206
|
# word-split: quoting $rest whole makes dnf look for one
|
||||||
to_install+=(${rest})
|
# package named "qemu-kvm libvirt ..." (seen on the VM)
|
||||||
|
# shellcheck disable=SC2206
|
||||||
|
local -a item_pkgs=(${rest})
|
||||||
|
step "Installing from $cat: ${item_pkgs[*]}"
|
||||||
|
if install_category_pkgs "$cat" "${item_pkgs[@]}"; then
|
||||||
|
done_any=true
|
||||||
|
else
|
||||||
|
color_red " Installation failed: $lbl"
|
||||||
|
color_red " (dnf reported no match / transaction failure — see output above)"
|
||||||
|
warn " Continuing with the remaining picks; the system is otherwise unchanged."
|
||||||
|
pause_if_debug
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
done <<< "$sel"
|
done <<< "$sel"
|
||||||
|
|
||||||
if (( ${#to_install[@]} > 0 )); then
|
|
||||||
step "Installing from $cat: ${to_install[*]}"
|
|
||||||
# install_category_pkgs wires any needed third-party repo first.
|
|
||||||
# Failure must NOT kill the script: warn in red and drop back to
|
|
||||||
# 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
|
|
||||||
done
|
done
|
||||||
# not `&& ok` — a false done_any would return 1 and kill the script under set -e
|
# not `&& ok` — a false done_any would return 1 and kill the script under set -e
|
||||||
if [[ "$done_any" == "true" ]]; then
|
if [[ "$done_any" == "true" ]]; then
|
||||||
@@ -514,11 +510,18 @@ install_category_pkgs() {
|
|||||||
sudo dnf install -y "https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm"
|
sudo dnf install -y "https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm"
|
||||||
fi
|
fi
|
||||||
if $needs_brave && ! pkg_installed brave-browser; then
|
if $needs_brave && ! pkg_installed brave-browser; then
|
||||||
info "Adding Brave repo..."
|
# dnf5 (Fedora 41+) has no 'config-manager add' subcommand —
|
||||||
sudo dnf install -y dnf-plugins-core
|
# the VM showed 'Unknown argument "add"', so the repo never
|
||||||
sudo dnf config-manager add --from-repofile=https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo || \
|
# landed and brave-browser had no match. Correct form per
|
||||||
true
|
# Brave's own F41+ docs: addrepo. The .repo carries the gpgkey,
|
||||||
sudo rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc 2>/dev/null || true
|
# so no separate rpm --import is needed.
|
||||||
|
if [[ -f /etc/yum.repos.d/brave-browser.repo ]]; then
|
||||||
|
ok "Brave repo already present."
|
||||||
|
else
|
||||||
|
info "Adding Brave repo (dnf5 addrepo)..."
|
||||||
|
sudo dnf config-manager addrepo \
|
||||||
|
--from-repofile=https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user