Update shell tests for operand delimiters

This commit is contained in:
LM committed 2026-09-12 20:10:41 +02:00
1 parent b72d7e5768
commit 21cf0db6e9
4 files changed
+34 -9

No files matched your search

+1 -1
View File
@@ -80,7 +80,7 @@ fi
# one transaction, so a failed install leaves the existing driver in place.
if omarchy-pkg-missing libfprint-git fprintd usbutils; then
echo "Installing required packages..."
sudo pacman -S --needed --noconfirm --ask 4 libfprint-git fprintd usbutils
sudo pacman -S --needed --noconfirm --ask 4 -- libfprint-git fprintd usbutils
fi
# Enroll first fingerprint
@@ -24,12 +24,26 @@ STUB
cat > "$scratch/bin/pacman" <<'STUB'
#!/bin/bash
case "$1" in
-Q) grep -qx "$2" <<< "${INSTALLED:-}" || grep -qx "$2" "$INSTALLED_LOG" ;;
-Q)
if [[ $2 == "--" ]]; then
shift 2
else
shift
fi
if grep -qx -- "$1" <<< "${INSTALLED:-}"; then
:
else
grep -qx -- "$1" "$INSTALLED_LOG"
fi
;;
-S)
printf 'pacman %s\n' "$*" >> "$CALL_LOG"
for arg in "$@"; do
[[ $arg == -* ]] || printf '%s\n' "$arg" >> "$INSTALLED_LOG"
done
if [[ $4 == "--" ]]; then
shift 4
for arg in "$@"; do
printf '%s\n' "$arg" >> "$INSTALLED_LOG"
done
fi
;;
*) printf 'pacman %s\n' "$*" >> "$CALL_LOG" ;;
esac
@@ -44,7 +58,7 @@ run_migration() {
}
INSTALLED='fprintd' run_migration
grep -qx 'pacman -S --noconfirm --needed libfprint-git' "$CALL_LOG" || fail "fprintd without a library gets libfprint-git"
grep -qx 'pacman -S --noconfirm --needed -- libfprint-git' "$CALL_LOG" || fail "fprintd without a library gets libfprint-git"
pass "fprintd without a library gets libfprint-git"
INSTALLED=$'libfprint-git\nfprintd' run_migration
+9 -2
View File
@@ -30,7 +30,14 @@ STUB
cat > "$scratch/bin/pacman" <<'STUB'
#!/bin/bash
case "$1" in
-Q) grep -qx "$2" <<< "${INSTALLED:-}" ;;
-Q)
if [[ $2 == "--" ]]; then
shift 2
else
shift
fi
grep -qx -- "$1" <<< "${INSTALLED:-}"
;;
-S)
printf 'pacman %s\n' "$*" >> "$CALL_LOG"
exit "${INSTALL_STATUS:-0}"
@@ -62,7 +69,7 @@ run_setup() {
}
assert_installs() {
grep -qx 'pacman -S --needed --noconfirm --ask 4 libfprint-git fprintd usbutils' "$CALL_LOG" || fail "$1"
grep -qx 'pacman -S --needed --noconfirm --ask 4 -- libfprint-git fprintd usbutils' "$CALL_LOG" || fail "$1"
(( $(grep -c '^pacman ' "$CALL_LOG") == 1 )) || fail "$1: one pacman transaction"
}
+5 -1
View File
@@ -118,7 +118,11 @@ Version : 9.2-1
INFO
;;
-Q)
shift
if [[ $2 == "--" ]]; then
shift 2
else
shift
fi
for want in "$@"; do
case "${want%%[<>=]*}" in bash | gvim | sh | vim | xxd) ;; *) exit 1 ;; esac
done