automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

backcompat5.test: avoid '##'-style comments inside recipe commands. (was


From: Ralf Wildenhues
Subject: backcompat5.test: avoid '##'-style comments inside recipe commands. (was: Testsuite failures on Tru64 OSF 5.1)
Date: Tue, 16 Nov 2010 19:26:36 +0100
User-agent: Mutt/1.5.20 (2010-08-04)

* Stefano Lattarini wrote on Mon, Nov 15, 2010 at 11:57:14PM CET:
> On Monday 15 November 2010, Ralf Wildenhues wrote:
> > * Stefano Lattarini wrote on Sun, Nov 14, 2010 at 11:00:16PM CET:
> > >  <http://autobuild.josefsson.org/automake/log-201011141902490189000.txt>
> > 
> > > > FAIL: backcompat5.test (exit: 1)
> > > > ================================
> > > >
> > > [CUT]
> > > > find ../foo-1.0 -print ## useful for debugging
> > > > find: missing conjunction
> > > > *** Exit 1
> > > > Stop.
> > > Seems like a limitation (bug) of the find utility; what I'd do is
> > > replacing the above find command simply with:
> > >   find ../foo-1.0
> > > WDYT?
> > 
> > I think the comment is taken as part of the command.
> Hmm... that's an automake comment: shouldn't automake strip it?

Quoting automake.info:

     Automake also allows a form of comment that is _not_ copied into the
  output; all lines beginning with `##' (leading spaces allowed) are
  completely ignored by Automake.

Letting automake strip '##.*' within recipe commands is not safe, if we
acknowledge that some makes obey decent quoting semantics (keeping '#'
inside single- or double-quoted strings) and the user may rely on that.

> But even
> if it doesn't, shouldn't the comment in question be consired a shell
> comment anyway?  If that's not the case, well, I'd regard this behaviour
> as a severe bug in the OSF make implementation.

Yes, and it is quite well documented in
  info Autoconf 'Comments in Make Rules'

I'm pushing the patch below to fix the issues I found, to
master and maint, respectively.  confh and confh8 didn't actually fail,
but it's better to not have confusing code.

Cheers,
Ralf

    backcompat5.test: avoid '##'-style comments inside recipe commands.
    
    * tests/backcompat5.test: Remove double-hash comments
    from makefile rule commands, they are not part of the
    Automake API.  Fixes testsuite failure with Tru64 make.

diff --git a/tests/backcompat5.test b/tests/backcompat5.test
index b68316d..50538cc 100755
--- a/tests/backcompat5.test
+++ b/tests/backcompat5.test
@@ -63,7 +63,7 @@ END
 
 cat >hacky/Makefile.am <<'END'
 dist-hook:
-       find $(top_distdir) -print ## useful for debugging
+       find $(top_distdir) -print
        chmod a+rx $(top_distdir)/tests/*.test
 END

 

    tests: avoid '##'-style comments inside recipe commands.
    
    * tests/confh.test, tests/confh8.test: Remove
    double-hash comments from makefile rule commands, they
    are not part of the Automake API.

diff --git a/tests/confh.test b/tests/confh.test
index 34674cc..93badef 100755
--- a/tests/confh.test
+++ b/tests/confh.test
@@ -30,10 +30,10 @@ END
 cat > Makefile.am << 'END'
 .PHONY: test1 test2
 test1:
-       @echo DIST_COMMON = $(DIST_COMMON) ## for debugging
+       @echo DIST_COMMON = $(DIST_COMMON)
        echo ' ' $(DIST_COMMON) ' ' | grep '[ /]acconfig\.h '
 test2: distdir
-       ls -l $(distdir)/* ## for debugging
+       ls -l $(distdir)/*
        test -f $(distdir)/acconfig.h
 check-local: test1 test2
 END
diff --git a/tests/confh8.test b/tests/confh8.test
index df985ec..146d2f0 100755
--- a/tests/confh8.test
+++ b/tests/confh8.test
@@ -29,7 +29,7 @@ END
 cat > Makefile.am << 'END'
 .PHONY: test0 test1 test2
 test0:
-       @echo DIST_COMMON = $(DIST_COMMON) ## for debugging
+       @echo DIST_COMMON = $(DIST_COMMON)
        echo ' ' $(DIST_COMMON) ' ' | grep '[ /]one\.h\.in '
        echo ' ' $(DIST_COMMON) ' ' | grep '[ /]two\.h\.in '
        : Processed header files should not be distributed.
@@ -42,7 +42,7 @@ test1: all
        test -f one.h
        test -f two.h
 test2: distdir
-       ls -l $(distdir)/* ## for debugging
+       ls -l $(distdir)/*
        test -f $(distdir)/one.h.in
        test -f $(distdir)/two.h.in
        : Processed header files should not be distributed.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]