]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
automake: be robust against directories containing ().
authorZack Weinberg <zackw@panix.com>
Sun, 6 Sep 2020 01:12:48 +0000 (18:12 -0700)
committerKarl Berry <karl@freefriends.org>
Sun, 6 Sep 2020 01:12:48 +0000 (18:12 -0700)
This change fixes https://bugs.gnu.org/14196.

* m4/missing.m4 (AM_MISSING_HAS_RUN): always quote the
invocation (not just if $am_aux_dir contains space or tab), in
case $am_aux_dir contains () or other metachars not rejected by
AM_SANITY_CHECK; quoting with '...' suggested by Jim Meyering.
* t/man6.sh (HELP2MAN): adjust grep since missing value
is quoted now.
* t/am-missing-prog.sh: likewise.

m4/missing.m4
t/am-missing-prog.sh
t/man6.sh

index 6f742fb204a444e975dc22f79eb6bd444ca1b698..14448bf18762665d4d4cd70ee7d3d409c6497a77 100644 (file)
@@ -21,12 +21,7 @@ AC_DEFUN([AM_MISSING_HAS_RUN],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 AC_REQUIRE_AUX_FILE([missing])dnl
 if test x"${MISSING+set}" != xset; then
-  case $am_aux_dir in
-  *\ * | *\    *)
-    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
-  *)
-    MISSING="\${SHELL} $am_aux_dir/missing" ;;
-  esac
+  MISSING="\${SHELL} '$am_aux_dir/missing'"
 fi
 # Use eval to expand $SHELL
 if eval "$MISSING --is-lightweight"; then
index df26b04fd142917ecf758afef8ff070f1b986018..1a5cb7fa52cac85c6a2e07f9b860e9acb1ad9a37 100644 (file)
@@ -86,9 +86,9 @@ $AUTOMAKE
 
 $FGREP COMMAND Makefile.in Makefile # For debugging.
 
-grep "^NO_SUCH_COMMAND = \${SHELL} .*/missing .*am-none-none" Makefile
-grep "^MISMATCHED_COMMAND = \${SHELL} .*/missing .*am-exit-63" Makefile
-grep "^COMMAND_FOUND = \${SHELL} .*/missing .*my-command" Makefile
+grep "^NO_SUCH_COMMAND = \${SHELL} .*/missing.* .*am-none-none" Makefile
+grep "^MISMATCHED_COMMAND = \${SHELL} .*/missing.* .*am-exit-63" Makefile
+grep "^COMMAND_FOUND = \${SHELL} .*/missing.* .*my-command" Makefile
 grep '^OVERRIDDEN_COMMAND = am-overridden *$' Makefile
 
 $MAKE test1 test2 test3 test4
index c62c7d114ba50b30fb5ff5b01dd3e3e46640d9bf..b354ec9ad60e424f1f95092cfcfad1a09a827410 100644 (file)
--- a/t/man6.sh
+++ b/t/man6.sh
@@ -64,8 +64,10 @@ mkdir build
 cd build
 
 ../configure
-# Sanity check.
-grep '^HELP2MAN *=.*/missing help2man' Makefile
+# Sanity check. The line we're matching looks like this:
+#   HELP2MAN = ${SHELL} '/am/checkout/t/man6.dir/missing' help2man
+# so let's not try to match the exact intervening quote.
+grep '^HELP2MAN *=.*/missing.* help2man' Makefile
 
 $MAKE
 $FGREP foobar ../foobar.1
@@ -83,8 +85,8 @@ cd ..
 rm -f *.1 # Remove leftover generated manpages.
 
 ./configure
-# Sanity check.
-grep '^HELP2MAN *=.*/missing help2man' Makefile
+# Sanity check again, same as above.
+grep '^HELP2MAN *=.*/missing.* help2man' Makefile
 
 $MAKE
 $FGREP foobar  foobar.1