fix(install): manifest parser emitted comment-padded tokens; AUR phase must run unprivileged (makepkg refuses root) with primed sudo timestamp
This commit is contained in:
1 parent
ea8d378a40
commit
07a95815d2
1 file changed
+11
-7
+11
-7
@@ -37,9 +37,8 @@ SUDO() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
read_manifest() { # $1 = manifest path; emits package names, strips comments/blanks
|
read_manifest() { # $1 = manifest path; emits package names, strips comments/blanks
|
||||||
sed 's/#.*//' "$1" | tr -d '\r' | awk 'NF'
|
sed 's/#.*//' "$1" | tr -d '\r' | awk '{if ($1) print $1}'
|
||||||
}
|
}
|
||||||
|
|
||||||
# ---- desired-minus-installed delta ------------------------------------------
|
# ---- desired-minus-installed delta ------------------------------------------
|
||||||
PKGS=()
|
PKGS=()
|
||||||
for m in common.pkgs "$HOST.pkgs"; do
|
for m in common.pkgs "$HOST.pkgs"; do
|
||||||
@@ -82,11 +81,16 @@ if [[ ${#AUR_PKGS[@]} -gt 0 ]] && ! pacman -Qq yay >/dev/null 2>&1; then
|
|||||||
SUDO pacman -S --needed --noconfirm -- yay
|
SUDO pacman -S --needed --noconfirm -- yay
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for p in "${AUR_PKGS[@]}"; do
|
# AUR builds must NOT run as root (makepkg refuses); yay escalates only for
|
||||||
printf '%s\n' "${INSTALLED[@]}" | grep -qx -- "$p" || {
|
# the final package install via its internal sudo — prime the timestamp cache.
|
||||||
YAYFLAGS="--answerclean None --answerdiff None" SUDO yay -S --needed --noconfirm -- "$p"
|
if [[ ${#AUR_PKGS[@]} -gt 0 ]]; then
|
||||||
}
|
if [[ -n "${FRANK_SUDO_PW:-}" ]]; then printf '%s' "$FRANK_SUDO_PW" | sudo -S -p '' true; fi
|
||||||
done
|
for p in "${AUR_PKGS[@]}"; do
|
||||||
|
printf '%s\n' "${INSTALLED[@]}" | grep -qx -- "$p" || {
|
||||||
|
YAYFLAGS="--answerclean None --answerdiff None" yay -S --needed --noconfirm --aur -- "$p"
|
||||||
|
}
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
# ---- host-gated enablement ---------------------------------------------------
|
# ---- host-gated enablement ---------------------------------------------------
|
||||||
case "$HOST" in
|
case "$HOST" in
|
||||||
|
|||||||
Reference in new issue
Block a user