hypr overhaul

This commit is contained in:
2026-09-20 14:40:45 +02:00
parent 85fc7f0e4a
commit 384cd84a6e
10 changed files with 215 additions and 58 deletions
+26 -13
View File
@@ -152,12 +152,20 @@ NOOP
export PATH="$HOME/bin:$PATH"
# 2c. setup.sh package parsing sanity (mirrors read_packages) for each
# package dir: basic/term/utils.
for d in basic term utils; do
if ( cd "$REPO" && bash -n "$d/setup.sh" ); then
say_ok "$d/setup.sh syntax OK"
# package dir: basic/term/utils/hypr. term/ and hypr/ keep their scripts
# inside scripts/ so stowing the top-level dir only creates .config/ links.
for d in basic term utils hypr; do
if [[ "$d" == "term" || "$d" == "hypr" ]]; then
SETUP_PATH="$d/scripts/setup.sh"
PKG_PATH="$d/scripts/packages.txt"
else
say_fail "$d/setup.sh syntax error"
SETUP_PATH="$d/setup.sh"
PKG_PATH="$d/packages.txt"
fi
if ( cd "$REPO" && bash -n "$SETUP_PATH" ); then
say_ok "$SETUP_PATH syntax OK"
else
say_fail "$SETUP_PATH syntax error"
fi
pacman_count=$(awk '
/^@pacman/{s="pacman"; next}
@@ -167,9 +175,9 @@ NOOP
/^[[:space:]]*$/{next}
s=="pacman"{pc++} s=="aur"{ac++} s=="npm"{nc++}
END{printf "%d %d %d", pc,ac,nc}
' "$REPO/$d/packages.txt")
' "$REPO/$PKG_PATH")
read -r PC AC NC <<< "$pacman_count"
say_ok "$d/packages.txt -> ${PC} pacman, ${AC} aur, ${NC} npm entries"
say_ok "$PKG_PATH -> ${PC} pacman, ${AC} aur, ${NC} npm entries"
done
# 2c2. Every @pacman entry in every packages.txt must resolve in the
@@ -179,7 +187,12 @@ NOOP
# AUR-only name (e.g. `rd`) fails here before any install happens.
header "package resolvability (@pacman entries)"
resolv_fail=0
for d in basic term utils; do
for d in basic term utils hypr; do
if [[ "$d" == "term" || "$d" == "hypr" ]]; then
PKG_PATH="$d/scripts/packages.txt"
else
PKG_PATH="$d/packages.txt"
fi
while IFS= read -r pkg; do
[[ -z "$pkg" ]] && continue
if pacman -S --print-format '%n' "$pkg" >/dev/null 2>&1; then
@@ -195,7 +208,7 @@ NOOP
/^@npm/{s="skip"; next}
/^[[:space:]]*#/{next} /^[[:space:]]*$/{next}
s=="pacman"{ sub(/^[^\/]*\//,""); print }
' "$REPO/$d/packages.txt")
' "$REPO/$PKG_PATH")
done
# 2d. If network allowed and not skipped, actually install the pacman
@@ -205,20 +218,20 @@ NOOP
header "make term (pacman + npm packages, AUR skipped)"
# Patch packages.txt: keep @pacman and @npm (@npm runs via sudo npm
# in the container), drop @aur so we don't hit AUR builds.
cp "$REPO/term/packages.txt" "$HOME/packages.txt.full"
cp "$REPO/term/scripts/packages.txt" "$HOME/packages.txt.full"
awk '
/^@aur$/{s="skip"}; /^@npm$/{s="npm"}; /^@pacman$/{s="pacman"}
{ if (s!="skip" && NF>0 && $1 !~ /^#/) print }
' "$REPO/term/packages.txt" > "$HOME/packages.txt.term-smoke"
' "$REPO/term/scripts/packages.txt" > "$HOME/packages.txt.term-smoke"
# pacman-only list for verify_packages.sh (npm packages are not in
# the pacman DB).
awk '
/^@aur$/{s="skip"}; /^@npm$/{s="skip"}; /^@pacman$/{s="pacman"}
{ if (s!="skip" && NF>0 && $1 !~ /^#/) print }
' "$REPO/term/packages.txt" > "$HOME/packages.txt.term-only"
' "$REPO/term/scripts/packages.txt" > "$HOME/packages.txt.term-only"
# set a scratch HOME for setup.sh so it doesn't touch the real one.
mkdir -p "$HOME/term"
cp "$REPO/term/setup.sh" "$HOME/term/setup.sh"
cp "$REPO/term/scripts/setup.sh" "$HOME/term/setup.sh"
cp "$HOME/packages.txt.term-smoke" "$HOME/term/packages.txt"
# chsh is stubbed via $HOME/bin so even `chsh` works without a pty.
setup_ok=0