* t/built-sources.sh (Makefile.am): In a recipe, use 'printf', not 'echo',
to print a string containing a "\n" sequence, because that is interpreted
like a newline by the echo built-in og NetBSD 5.1 /bin/ksh.
* t/maken.sh: Don't expect the timestamp of the current directory to be
unchanged after "make -n" is run in it; this doesn't hold on NetBSD 5.1.
Instead, make the current directory unwritable before running "make -n",
to ensure that doesn't try to write anything in it.

Signed-off-by: Stefano Lattarini <[email protected]>
---

 Will push this tomorrow morning.

 Regards,
   Stefano

 t/built-sources.sh |   14 ++++++++------
 t/maken.sh         |    4 +++-
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/t/built-sources.sh b/t/built-sources.sh
index 902cee1..b61b556 100755
--- a/t/built-sources.sh
+++ b/t/built-sources.sh
@@ -29,12 +29,14 @@ BUILT_SOURCES = foo.c
 noinst_PROGRAMS = bar baz
 foo.c:
        rm -f $@ $@-t
-       echo '#include <stdio.h>'               >  $@-t
-       echo 'int main (void)'                  >> $@-t
-       echo '{               '                 >> $@-t
-       echo '  printf ("%s\n", FOOMSG);'       >> $@-t
-       echo '  return 0;'                      >> $@-t
-       echo '}'                                >> $@-t
+       # Use printf, not echo, to avoid spurious interpretation of
+       # the "\n" as a newline (see on NetBSD 5.1).
+       printf '%s\n' '#include <stdio.h>'               >  $@-t
+       printf '%s\n' 'int main (void)'                  >> $@-t
+       printf '%s\n' '{               '                 >> $@-t
+       printf '%s\n' '  printf ("%s\n", FOOMSG);'       >> $@-t
+       printf '%s\n' '  return 0;'                      >> $@-t
+       printf '%s\n' '}'                                >> $@-t
        mv -f $@-t $@
 CLEANFILES = foo.c
 END
diff --git a/t/maken.sh b/t/maken.sh
index ec992bf..e4254e5 100755
--- a/t/maken.sh
+++ b/t/maken.sh
@@ -50,10 +50,12 @@ $AUTOMAKE
 for target in dist distcheck; do
   echo stamp > stampfile
   $sleep
+  chmod a-w .
   $MAKE -n $target
   $MAKE -n $target | grep stamp-sub-dist-hook
+  chmod u+w .
   # No file has been actually touched or created.
-  is_newest stampfile $(find .)
+  is_newest stampfile $(find . | grep -v '^\.$')
   $MAKE test-no-distdir
 done
 
-- 
1.7.9.5


Reply via email to