Repo guards (repolist) + PeaZip flavor guard #14
@@ -640,29 +640,41 @@ rule
|
|||||||
# environments, GTK3 for the rest) ---
|
# environments, GTK3 for the rest) ---
|
||||||
info "Tailoring toolkits for DE=$DE / TWM=$TWM..."
|
info "Tailoring toolkits for DE=$DE / TWM=$TWM..."
|
||||||
|
|
||||||
# First: is ANY PeaZip flavor already installed? The UI flavors all ship
|
# The UI flavors all ship /usr/bin/peazip and file-conflict with each
|
||||||
# /usr/bin/peazip and file-conflict with each other — installing gtk3 over
|
# other — installing gtk3 over an existing qt5 dies mid-transaction
|
||||||
# an existing qt5 dies mid-transaction (laptop-proven). Any present flavor
|
# (laptop-proven). Behaviors:
|
||||||
# wins; skipping is correct.
|
# no flavor -> install the environment-appropriate one
|
||||||
|
# right flavor -> nothing to do
|
||||||
|
# OTHER flavor -> dnf SWAP to the wanted one (atomic: on failure the
|
||||||
|
# existing flavor stays, which is the safe outcome)
|
||||||
|
if [[ "$DE" == "plasma" || "$TWM" == "hyprland" ]]; then
|
||||||
|
peazip_wanted="peazip-qt6"
|
||||||
|
else
|
||||||
|
# XFCE, GNOME, Niri, MangoWC, chadwm: lightweight/generic toolkits
|
||||||
|
peazip_wanted="peazip-gtk3"
|
||||||
|
fi
|
||||||
peazip_existing=""
|
peazip_existing=""
|
||||||
local_v=""
|
local_v=""
|
||||||
for local_v in peazip-qt5 peazip-qt6 peazip-gtk3 peazip-gtk2; do
|
for local_v in peazip-qt5 peazip-qt6 peazip-gtk3 peazip-gtk2; do
|
||||||
pkg_installed "$local_v" && peazip_existing="$local_v"
|
pkg_installed "$local_v" && peazip_existing="$local_v"
|
||||||
done
|
done
|
||||||
if [[ -n "$peazip_existing" ]]; then
|
|
||||||
ok "PeaZip already present ($peazip_existing) - skipping."
|
if [[ -z "$peazip_existing" ]]; then
|
||||||
else
|
|
||||||
if [[ "$DE" == "plasma" || "$TWM" == "hyprland" ]]; then
|
|
||||||
peazip_pkgs="peazip-common peazip-qt6"
|
|
||||||
else
|
|
||||||
# XFCE, GNOME, Niri, MangoWC, chadwm: lightweight/generic toolkits
|
|
||||||
peazip_pkgs="peazip-common peazip-gtk3"
|
|
||||||
fi
|
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
if ! install_packages $peazip_pkgs; then
|
if ! install_packages peazip-common "$peazip_wanted"; then
|
||||||
color_red " Failed: $peazip_pkgs"
|
color_red " Failed: peazip-common $peazip_wanted"
|
||||||
color_red " (continuing — PeaZip is a convenience, not a dependency)"
|
color_red " (continuing — PeaZip is a convenience, not a dependency)"
|
||||||
fi
|
fi
|
||||||
|
elif [[ "$peazip_existing" == "$peazip_wanted" ]]; then
|
||||||
|
ok "PeaZip already present ($peazip_existing)."
|
||||||
|
else
|
||||||
|
info "PeaZip $peazip_existing does not match this environment — swapping to $peazip_wanted..."
|
||||||
|
if ui_quiet_run "Swapping PeaZip: $peazip_existing -> $peazip_wanted" \
|
||||||
|
sudo dnf swap -y "$peazip_existing" "$peazip_wanted"; then
|
||||||
|
ok "PeaZip swapped to $peazip_wanted."
|
||||||
|
else
|
||||||
|
warn "Swap failed — keeping the existing $peazip_existing (fully functional)."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
pause_if_debug
|
pause_if_debug
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user