From a55cb7aadb0ed2f11a9454e180439cd167f03bf3 Mon Sep 17 00:00:00 2001 From: ShortArrow Date: Wed, 21 Oct 2026 14:10:51 +0900 Subject: [PATCH] fix: match the version apt-cache madison pads with spaces --- .gitattributes | 1 + scripts/check-install.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfdb8b7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.sh text eol=lf diff --git a/scripts/check-install.sh b/scripts/check-install.sh index f375dd7..10075cf 100644 --- a/scripts/check-install.sh +++ b/scripts/check-install.sh @@ -25,7 +25,8 @@ version=$2 upstream=$3 shift 3 -apt-cache madison "$package" | grep -F "| $version |" +apt-cache madison "$package" | tee /dev/stderr | + awk -F'|' -v want="$version" '{ gsub(/ /, "", $2) } $2 == want { found = 1 } END { exit !found }' apt-get install -y -qq "$package=$version" >/dev/null output=$("$@") echo "$output"