1
0
Fork 0

Skip-sudo fixes for run_once_40 and run_once_20

Three real bugs caught during the bit-cachyos deploy:

1. wl-clipboard false-positive: 'command -v wl-clipboard' returns
   nothing because the package ships wl-copy/wl-paste, not a
   'wl-clipboard' binary. Sudo pacman was being called every apply
   even though wl-clipboard is installed. Fix: declare -A PKG_BIN
   map in the script.

2. omp segfault aborts the whole bootstrap: on rye, 'bun add -g
   @oh-my-pi/pi-coding-agent' segfaults (Pi undervoltage, see
   pitfall #30). The 'set -e' caused the whole run_once_20 to abort
   before getting to neovim/oh-my-zsh/zshrc etc. Fix: wrap the bun
   add in a subshell with error tolerance, log a warning, keep going.

3. rorclar/sourdough reference cleanup: removed the old chaotic-aur
   comment which mentioned the wrong sudo pattern (now fixed in the
   other run_once scripts).

Re-applied on bit, miche, byte, kaiser, crouton (rye skipped because
of the undervoltage hardware issue).
This commit is contained in:
Rain 2026-06-22 15:17:58 -04:00
parent b40d724f6c
commit 5e7fd61f02
2 changed files with 26 additions and 3 deletions

View file

@ -40,9 +40,18 @@ log "checking sway stack: ${SWAY_PKGS[*]}"
# Only invoke sudo if any of the packages are missing. Bit has most
# already; byte/kaiser are full. This avoids a no-op sudo prompt.
#
# Note: a few packages ship their CLI binary under a different name
# (e.g. wl-clipboard provides wl-copy/wl-paste, not `wl-clipboard`).
# Map those to the actual binary we use.
declare -A PKG_BIN=(
[wl-clipboard]="wl-copy"
[mako]="mako"
)
MISSING_PKGS=()
for p in "${SWAY_PKGS[@]}"; do
if ! command -v "$p" >/dev/null 2>&1; then
bin="${PKG_BIN[$p]:-$p}"
if ! command -v "$bin" >/dev/null 2>&1; then
MISSING_PKGS+=("$p")
fi
done