Files
MSYS2-packages/pacman/0024-libmakepkg-fix-compatibility-with-bash-5.2-globskipd.patch
Christoph Reiter 3b62953e26 pacman: Update
rebuild and sync in the bash 5.2 fix
2022-11-04 20:41:06 +01:00

40 lines
1.3 KiB
Diff

From 80f01df7fbc2c3424e191119915849d18b63523c Mon Sep 17 00:00:00 2001
From: Allan McRae <allan@archlinux.org>
Date: Sun, 2 Oct 2022 11:40:52 +1000
Subject: [PATCH 24/N] libmakepkg: fix compatibility with bash-5.2
globskipdots
Bash 5.2 has a new globskipdots option, which is enabled by default. The
check_dotfiles lint fails with globskipdots due to the assumption that
at least the "." and ".." paths will match. Disabling globskipdots would
be the usual solution, but that fails on bash<5.2. Instead, enable
nullglob for this check.
Signed-off-by: Allan McRae <allan@archlinux.org>
---
scripts/libmakepkg/lint_package/dotfiles.sh.in | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/scripts/libmakepkg/lint_package/dotfiles.sh.in b/scripts/libmakepkg/lint_package/dotfiles.sh.in
index bf6c754..ac86b02 100644
--- a/scripts/libmakepkg/lint_package/dotfiles.sh.in
+++ b/scripts/libmakepkg/lint_package/dotfiles.sh.in
@@ -29,10 +29,17 @@ lint_package_functions+=('check_dotfiles')
check_dotfiles() {
local ret=0
+
+ local shellopts=$(shopt -p nullglob)
+ shopt -s nullglob
+
for f in "$pkgdir"/.*; do
[[ ${f##*/} == . || ${f##*/} == .. ]] && continue
error "$(gettext "Dotfile found in package root '%s'")" "$f"
ret=1
done
+
+ eval "$shellopts"
+
return $ret
}