hypr overhaul
This commit is contained in:
+26
-13
@@ -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
|
||||
|
||||
+20
-11
@@ -80,24 +80,33 @@ fi
|
||||
# 4. packages.txt parsing sanity (mirrors each setup.sh read_packages).
|
||||
# ---------------------------------------------------------------------------
|
||||
echo "== Checking packages.txt markers =="
|
||||
for pkgdir in term basic utils; do
|
||||
if ! [[ -f "$pkgdir/packages.txt" ]]; then
|
||||
say_fail "$pkgdir/packages.txt missing"
|
||||
for pkgdir in term basic utils hypr; do
|
||||
# term/ and hypr/ keep packages.txt + setup.sh inside scripts/ so stowing
|
||||
# the top-level dir only creates .config/ symlinks.
|
||||
if [[ "$pkgdir" == "term" || "$pkgdir" == "hypr" ]]; then
|
||||
PKG_FILE="$pkgdir/scripts/packages.txt"
|
||||
SETUP_FILE="$pkgdir/scripts/setup.sh"
|
||||
else
|
||||
PKG_FILE="$pkgdir/packages.txt"
|
||||
SETUP_FILE="$pkgdir/setup.sh"
|
||||
fi
|
||||
if ! [[ -f "$PKG_FILE" ]]; then
|
||||
say_fail "$PKG_FILE missing"
|
||||
continue
|
||||
fi
|
||||
if grep -q '^@pacman' "$pkgdir/packages.txt"; then
|
||||
say_pass "$pkgdir/packages.txt declares @pacman section"
|
||||
if grep -q '^@pacman' "$PKG_FILE"; then
|
||||
say_pass "$PKG_FILE declares @pacman section"
|
||||
else
|
||||
say_fail "$pkgdir/packages.txt missing @pacman marker"
|
||||
say_fail "$PKG_FILE missing @pacman marker"
|
||||
fi
|
||||
# every @aur/@npm marker must be matched by a real consumer in setup.sh
|
||||
for marker in '@aur' '@npm'; do
|
||||
if grep -q "^$marker" "$pkgdir/packages.txt"; then
|
||||
grep -q "$marker" "$pkgdir/setup.sh" \
|
||||
&& say_pass "$pkgdir/packages.txt $marker handled by $pkgdir/setup.sh" \
|
||||
|| say_fail "$pkgdir/packages.txt uses $marker but $pkgdir/setup.sh does not handle it"
|
||||
if grep -q "^$marker" "$PKG_FILE"; then
|
||||
grep -q "$marker" "$SETUP_FILE" \
|
||||
&& say_pass "$PKG_FILE $marker handled by $SETUP_FILE" \
|
||||
|| say_fail "$PKG_FILE uses $marker but $SETUP_FILE does not handle it"
|
||||
else
|
||||
say_pass "$pkgdir/packages.txt has no $marker section"
|
||||
say_pass "$PKG_FILE has no $marker section"
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
@@ -54,6 +54,18 @@ declare -A BINS=(
|
||||
[fzf]="fzf --version"
|
||||
[chromium]="chromium --version"
|
||||
[locate]="locate --version"
|
||||
# Hyprland compositor & ecosystem
|
||||
[hyprland]="hyprctl version"
|
||||
[waybar]="waybar --version"
|
||||
[hyprlock]="hyprlock --version"
|
||||
[hypridle]="hypridle --version"
|
||||
[hyprpaper]="hyprpaper -v"
|
||||
[rofi]="rofi -v"
|
||||
[swaync]="swaync --version"
|
||||
[nwg-drawer]="nwg-drawer --version"
|
||||
[wl-clipboard]="wl-copy --version"
|
||||
[hyprshot]="hyprshot --version"
|
||||
[wpaperd]="wpaperd --version"
|
||||
)
|
||||
|
||||
# python-pip may expose `pip` instead of `pip3` on some setups; treat them
|
||||
|
||||
Reference in New Issue
Block a user