NoSignal-OS/os updates/update-prompts-fix/patch-nosignal-update.sh
28allday 19fd794b6b NoSignal — fully-offline Arch → Hyprland desktop installer
Single-script builder (nosignal.sh) that turns a stock Arch Linux ISO into a
fully-offline installer for a themed Hyprland + caelestia (Quickshell) desktop:
matching SDDM greeter, Btrfs/Limine bootable snapshots, chwd-style GPU
detection, and a curated "os updates" layer (keybind cheatsheet, settings
panels, system polish, on-box management skill). See README.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 11:03:10 +01:00

36 lines
1.7 KiB
Bash
Executable file

#!/bin/sh
# patch-nosignal-update.sh — stop yay's interactive menus from stalling
# nosignal-update. Idempotent; no sudo (the script is user-owned).
#
# Symptom: mid-update, yay shows its "Packages to exclude" upgrade menu
# (and clean-build/diff menus when AUR packages build). A bare `==>`
# prompt after a wall of output reads as a hang — the user already
# answered the only prompt they expected ("Update NoSignal now? [y/N]").
#
# Fix: pre-answer all four yay menus with None. The pacman
# "Proceed with installation? [Y/n]" confirm is unaffected, and
# -y/--noconfirm behaviour is unchanged.
set -eu
TARGET=${TARGET:-$HOME/.local/share/nosignal/nosignal-update/bin/nosignal-update}
[ -f "$TARGET" ] || { echo "nosignal-update not found at $TARGET — nothing to patch"; exit 0; }
if grep -q 'answerupgrade' "$TARGET"; then
echo ":: nosignal-update already patched"
exit 0
fi
cp -n "$TARGET" "$TARGET.pre-menus-fix"
perl -0pi -e 's/ log "upgrading packages with \$HELPER"\n "\$HELPER" -Syu \$nc\n/ # yay menus (exclude\/clean\/diff\/edit PKGBUILD) look like a hang mid-update —\n # pre-answer them with None. The pacman proceed confirm still appears.\n local menus=""\n [ "\$HELPER" = yay ] \&\& menus="--answerupgrade None --answerclean None --answerdiff None --answeredit None"\n log "upgrading packages with \$HELPER"\n "\$HELPER" -Syu \$menus \$nc\n/' "$TARGET"
if grep -q 'answerupgrade' "$TARGET" && bash -n "$TARGET"; then
echo ":: patched $TARGET (yay menus pre-answered)"
else
echo "WARNING: patch did not apply cleanly — restoring backup." >&2
cp "$TARGET.pre-menus-fix" "$TARGET"
echo " update_packages() in nosignal-update changed shape; update the" >&2
echo " regex in $(basename "$0")." >&2
exit 1
fi