Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2019-04-10 01:50:31 -0400
committerAllan McRae <allan@archlinux.org>2019-05-08 10:14:32 +1000
commit6911904a033c1494f32f438f2d5cac2dc5b1ee19 (patch)
treee4a5acdd763f70a0c0027439023812761c468cb8 /scripts
parentf2a7fb2b96dd76f48b7750d1edeb6a85b7006856 (diff)
makepkg: fix bash 5 compatibility when packaging symlinks to a directory
In commit b5191ea140386dd9b73e4509ffa9a6d347c1b5fa we moved to using shell globbing to print package files for a couple of reasons including reproducible packaging of .METADATA files. Unfortunately, this only works reliably when the glob pattern does not resolve to a symlinked directory due to a change in the bash 5.0 release. Note that the previous, desired behavior was rather to merely refuse to recurse into symlinked directories, but due to an unrelated issue, the symlink handling for globstar was reworked in a way that had this side effect. See https://lists.gnu.org/archive/html/bug-bash/2019-04/msg00015.html for discussion; this may be fixed at some point, but bash 5.0 is broken either way. The appropriate way of handling this seems to be to use **/* to match instead; this produces the same results on both bash 4 and bash 5, as the ** matches any leading directory component (or none), and the * matches any file, directory, or symlink to either one. Fixes FS#62278 Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/makepkg.sh.in3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 4f096a36..fd06ce02 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -666,7 +666,8 @@ list_package_files() {
(
export LC_COLLATE=C
shopt -s dotglob globstar
- printf '%s\0' **
+ # bash 5.0 only works with combo directory + file globs
+ printf '%s\0' **/*
)
}