]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: really fix wildcard quoting in sc_tests_executable
authorPádraig Brady <P@draigBrady.com>
Fri, 20 Mar 2015 12:03:56 +0000 (12:03 +0000)
committerPádraig Brady <P@draigBrady.com>
Fri, 20 Mar 2015 14:34:31 +0000 (14:34 +0000)
* cfg.mk (sc_tests_executable): The previous commit avoided
the globbing, but also passed on the quoted wildcards to find(1).
We could use eval to handle the quoting, though that's a bit
awkward and dangerous, so instead explicitly disable globbing
for the whole make target subshell.  Note noglob is not available
on solaris, where we fall back to set -f.  Note also that zsh
uses set -F for this, but that's moot here.  Also correct the
find(1) expression to include the -o between each wildcard.

cfg.mk

diff --git a/cfg.mk b/cfg.mk
index a3b0e8e1d7c8fdd61bcebf50beab785c45e066f9..69a7776e6d7248b3bc60b6e7965ab867f6c1561c 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -116,9 +116,10 @@ sc_tests_list_consistency:
 
 # Ensure that all version-controlled test scripts are executable.
 sc_tests_executable:
-       @test_extensions_rx=`printf -- "-name '*%s' " $(TEST_EXTENSIONS)`;\
-       find tests/ \( $$test_extensions_rx \) \! -perm -u+x -print       \
-         | sed -e "s/^/$(ME): Please make test executable: /" | grep .   \
+       @set -o noglob 2>/dev/null || set -f;                              \
+       find_ext="-name '' "`printf -- "-o -name *%s " $(TEST_EXTENSIONS)`;\
+       find tests/ \( $$find_ext \) \! -perm -u+x -print                  \
+         | sed -e "s/^/$(ME): Please make test executable: /" | grep .    \
            && exit 1; :
 
 # Ensure all gnulib patches apply cleanly