Sort package manifests under LC_ALL=C

pkg-snapshot and dots used plain sort, which is locale-dependent: the same
package set ordered differently on two machines, so dots reported drift
that did not exist. A maintenance tool that always cries wolf is the exact
failure mode dots exists to avoid.
This commit is contained in:
connor committed 2026-09-14 14:47:26 -04:00
1 parent c0bd4f5b1d
commit 4d4242f103
2 files changed
+5 -5

No files matched your search

+2 -2
View File
@@ -19,10 +19,10 @@ fi
pkgdrift=0
tmp=$(mktemp)
if command -v pacman >/dev/null 2>&1; then
pacman -Qqen | sort > "$tmp"
pacman -Qqen | LC_ALL=C sort > "$tmp"
[[ -f "packages/${HOST}.pacman" ]] && ! diff -q "$tmp" "packages/${HOST}.pacman" >/dev/null && pkgdrift=1
elif command -v apt-mark >/dev/null 2>&1; then
apt-mark showmanual | sort > "$tmp"
apt-mark showmanual | LC_ALL=C sort > "$tmp"
[[ -f "packages/${HOST}.apt" ]] && ! diff -q "$tmp" "packages/${HOST}.apt" >/dev/null && pkgdrift=1
fi
rm -f "$tmp"