Avoid syntax error from bash 2.00 ... 2.05.
authorBruno Haible <bruno@clisp.org>
Mon, 23 Oct 2006 11:25:20 +0000 (11:25 +0000)
committerBruno Haible <bruno@clisp.org>
Mon, 23 Oct 2006 11:25:20 +0000 (11:25 +0000)
ChangeLog
gnulib-tool

index 190b68a..21adf8a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-10-21  Bruno Haible  <bruno@clisp.org>
+
+       * gnulib-tool (func_emit_lib_Makefile_am, func_emit_tests_Makefile_am):
+       Change mostlyclean-local rule to avoid sh syntax error from bash
+       versions 2.00..2.05 when $(MOSTLYCLEANDIRS) is empty.
+
 2006-10-23  Jim Meyering  <jim@meyering.net>
 
        * lib/getaddrinfo.c (getnameinfo): Use new lightweight uinttostr,
index a705f23..83d6528 100755 (executable)
@@ -22,7 +22,7 @@
 
 progname=$0
 package=gnulib
-cvsdatestamp='$Date: 2006-10-20 13:42:39 $'
+cvsdatestamp='$Date: 2006-10-23 11:25:20 $'
 last_checkin_date=`echo "$cvsdatestamp" | sed -e 's,^\$[D]ate: ,,'`
 version=`echo "$last_checkin_date" | sed -e 's/ .*$//' -e 's,/,-,g'`
 nl='
@@ -1214,12 +1214,11 @@ func_emit_lib_Makefile_am ()
   cat allsnippets.tmp
   echo
   echo "mostlyclean-local: mostlyclean-generic"
-  echo "       @test -z \"\$(MOSTLYCLEANDIRS)\" || \\"
-  echo "         for dir in \$(MOSTLYCLEANDIRS); do \\"
-  echo "           if test -d \$\$dir; then \\"
-  echo "             echo \"rmdir \$\$dir\"; rmdir \$\$dir; \\"
-  echo "           fi; \\"
-  echo "         done"
+  echo "       @for dir in '' \$(MOSTLYCLEANDIRS); do \\"
+  echo "         if test -n \"\$\$dir\" && test -d \$\$dir; then \\"
+  echo "           echo \"rmdir \$\$dir\"; rmdir \$\$dir; \\"
+  echo "         fi; \\"
+  echo "       done"
   rm -f allsnippets.tmp
 }
 
@@ -1317,12 +1316,11 @@ func_emit_tests_Makefile_am ()
   echo "       rm -rf SunWS_cache"
   echo
   echo "mostlyclean-local: mostlyclean-generic"
-  echo "       @test -z \"\$(MOSTLYCLEANDIRS)\" || \\"
-  echo "         for dir in \$(MOSTLYCLEANDIRS); do \\"
-  echo "           if test -d \$\$dir; then \\"
-  echo "             echo \"rmdir \$\$dir\"; rmdir \$\$dir; \\"
-  echo "           fi; \\"
-  echo "         done"
+  echo "       @for dir in '' \$(MOSTLYCLEANDIRS); do \\"
+  echo "         if test -n \"\$\$dir\" && test -d \$\$dir; then \\"
+  echo "           echo \"rmdir \$\$dir\"; rmdir \$\$dir; \\"
+  echo "         fi; \\"
+  echo "       done"
   rm -f allsnippets.tmp
 }