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:
parent
b40d724f6c
commit
5e7fd61f02
2 changed files with 26 additions and 3 deletions
|
|
@ -52,7 +52,14 @@ fi
|
||||||
if command -v bun >/dev/null 2>&1; then
|
if command -v bun >/dev/null 2>&1; then
|
||||||
if ! command -v omp >/dev/null 2>&1; then
|
if ! command -v omp >/dev/null 2>&1; then
|
||||||
log "installing @oh-my-pi/pi-coding-agent via bun global"
|
log "installing @oh-my-pi/pi-coding-agent via bun global"
|
||||||
bun add -g @oh-my-pi/pi-coding-agent 2>&1 | tail -10
|
# Wrap in subshell so a segfault/timeout (e.g. Pi undervoltage
|
||||||
|
# killing the install mid-run, see pitfall #30) doesn't abort
|
||||||
|
# the whole bootstrap. omp can be retried manually later.
|
||||||
|
if (bun add -g @oh-my-pi/pi-coding-agent 2>&1 | tail -10); then
|
||||||
|
log "omp installed: $(omp --version 2>&1 | head -1)"
|
||||||
|
else
|
||||||
|
log "WARNING: bun add -g failed; omp not installed. Retry manually."
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
log "omp already installed: $(omp --version 2>&1 | head -1)"
|
log "omp already installed: $(omp --version 2>&1 | head -1)"
|
||||||
fi
|
fi
|
||||||
|
|
@ -114,7 +121,14 @@ fi
|
||||||
if command -v bun >/dev/null 2>&1; then
|
if command -v bun >/dev/null 2>&1; then
|
||||||
if ! command -v omp >/dev/null 2>&1; then
|
if ! command -v omp >/dev/null 2>&1; then
|
||||||
log "installing @oh-my-pi/pi-coding-agent via bun global"
|
log "installing @oh-my-pi/pi-coding-agent via bun global"
|
||||||
bun add -g @oh-my-pi/pi-coding-agent 2>&1 | tail -10
|
# Wrap in subshell so a segfault/timeout (e.g. Pi undervoltage
|
||||||
|
# killing the install mid-run, see pitfall #30) doesn't abort
|
||||||
|
# the whole bootstrap. omp can be retried manually later.
|
||||||
|
if (bun add -g @oh-my-pi/pi-coding-agent 2>&1 | tail -10); then
|
||||||
|
log "omp installed: $(omp --version 2>&1 | head -1)"
|
||||||
|
else
|
||||||
|
log "WARNING: bun add -g failed; omp not installed. Retry manually."
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
log "omp already installed: $(omp --version 2>&1 | head -1)"
|
log "omp already installed: $(omp --version 2>&1 | head -1)"
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -40,9 +40,18 @@ log "checking sway stack: ${SWAY_PKGS[*]}"
|
||||||
|
|
||||||
# Only invoke sudo if any of the packages are missing. Bit has most
|
# 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.
|
# 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=()
|
MISSING_PKGS=()
|
||||||
for p in "${SWAY_PKGS[@]}"; do
|
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")
|
MISSING_PKGS+=("$p")
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue