automake-patches
[Top][All Lists]
Advanced

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

[FYI] {maint} maintcheck: fix maintainer-check failures, some real, some


From: Stefano Lattarini
Subject: [FYI] {maint} maintcheck: fix maintainer-check failures, some real, some spurious
Date: Wed, 3 Aug 2011 16:38:25 +0200
User-agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )

* tests/amhello-binpkg.test: Use "$MAKE", not bare "make".
* Makefile.am (sc_perl_local): Also allow perl special variable
`$~' to be localized.  And be slightly laxer in the regexp, to
allow for usages like "local $_ = $foo;".
(sc_tests_overriding_macros_on_cmdline): Also allow for command
line overriding of the `DISABLE_HARD_ERRORS' make variable.  Try
to avoid false positives for usages like "$MAKE || st=$?".
---
 ChangeLog                 |   11 +++++++++++
 Makefile.am               |   16 +++++++++-------
 Makefile.in               |    7 ++++---
 tests/amhello-binpkg.test |    4 ++--
 4 files changed, 26 insertions(+), 12 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8d5e33a..51a4e02 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-08-03  Stefano Lattarini  <address@hidden>
+
+       maintcheck: fix maintainer-check failures, both real and spurious
+       * tests/amhello-binpkg.test: Use "$MAKE", not bare "make".
+       * Makefile.am (sc_perl_local): Also allow perl special variable
+       `$~' to be localized.  And be slightly laxer in the regexp, to
+       allow for usages like "local $_ = $foo;".
+       (sc_tests_overriding_macros_on_cmdline): Also allow for command
+       line overriding of the `DISABLE_HARD_ERRORS' make variable.  Try
+       to avoid false positives for usages like "$MAKE || st=$?".
+
 2011-08-03  Bruno Haible  <address@hidden>
 
        docs: how to use '-I' option in AM_CPPFLAGS for best VPATH support
diff --git a/Makefile.am b/Makefile.am
index 835f00a..51eeb23 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -337,9 +337,9 @@ sc_perl_local_no_parens:
          exit 1; \
        fi
 
-## Allow only `local $_' in Automake.
+## Allow only few variables to be localized in Automake.
 sc_perl_local:
-       @if grep -v '^[ \t]*local \$$_;' $(srcdir)/automake.in | \
+       @if egrep -v '^[ \t]*local \$$[_~]( *=|;)' $(srcdir)/automake.in | \
                grep '^[ \t]*local [^*]'; then \
          echo "Please avoid \`local'." 1>&2; \
          exit 1; \
@@ -467,17 +467,19 @@ sc_tests_required_after_defs:
 
 ## Overriding a Makefile macro on the command line is not portable when
 ## recursive targets are used.  Better use an envvar.  SHELL is an
-## exception, POSIX says it can't come from the environment.  DESTDIR and
-## DISTCHECK_CONFIGURE_FLAGS and V are exceptions, too, as package authors
-## are urged not to initialize them anywhere.
+## exception, POSIX says it can't come from the environment.  V, DESTDIR,
+## DISTCHECK_CONFIGURE_FLAGS and DISABLE_HARD_ERRORS are exceptions, too,
+## as package authors are urged not to initialize them anywhere.
 sc_tests_overriding_macros_on_cmdline:
        @if grep -E '\$$MAKE .*(SHELL=.*=|=.*SHELL=)' $(srcdir)/tests/*.test; 
then \
          echo 'Rewrite "$$MAKE foo=bar SHELL=$$SHELL" as "foo=bar $$MAKE -e 
SHELL=$$SHELL"' 1>&2; \
          echo ' in the above lines, it is more portable.' 1>&2; \
          exit 1; \
        fi
-       @if sed -e 's/ DESTDIR=[^ ]*/ /' -e 's/ SHELL=[^ ]*/ /' \
-               -e 's/ V=[^ ]*/ /' -e 's///' \
+## Also try to account for usages like "$MAKE || st=$?".
+       @if sed -e 's/ || .*//' -e 's/ && .*//' \
+               -e 's/ DESTDIR=[^ ]*/ /' -e 's/ SHELL=[^ ]*/ /' \
+               -e 's/ V=[^ ]*/ /' -e 's/ DISABLE_HARD_ERRORS=[^ ]*/ /' \
 ## DISTCHECK_CONFIGURE_FLAGS is allowed to contain whitespace in its
 ## definition, so the more complex substitutions below.
                -e "s/ DISTCHECK_CONFIGURE_FLAGS='[^']*'/ /" \
diff --git a/Makefile.in b/Makefile.in
index 1c241e5..35a9cbd 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1048,7 +1048,7 @@ sc_perl_local_no_parens:
        fi
 
 sc_perl_local:
-       @if grep -v '^[ \t]*local \$$_;' $(srcdir)/automake.in | \
+       @if egrep -v '^[ \t]*local \$$[_~]( *=|;)' $(srcdir)/automake.in | \
                grep '^[ \t]*local [^*]'; then \
          echo "Please avoid \`local'." 1>&2; \
          exit 1; \
@@ -1162,8 +1162,9 @@ sc_tests_overriding_macros_on_cmdline:
          echo ' in the above lines, it is more portable.' 1>&2; \
          exit 1; \
        fi
-       @if sed -e 's/ DESTDIR=[^ ]*/ /' -e 's/ SHELL=[^ ]*/ /' \
-               -e 's/ V=[^ ]*/ /' -e 's///' \
+       @if sed -e 's/ || .*//' -e 's/ && .*//' \
+               -e 's/ DESTDIR=[^ ]*/ /' -e 's/ SHELL=[^ ]*/ /' \
+               -e 's/ V=[^ ]*/ /' -e 's/ DISABLE_HARD_ERRORS=[^ ]*/ /' \
                -e "s/ DISTCHECK_CONFIGURE_FLAGS='[^']*'/ /" \
                -e 's/ DISTCHECK_CONFIGURE_FLAGS="[^"]*"/ /' \
                -e 's/ DISTCHECK_CONFIGURE_FLAGS=[^ ]/ /' \
diff --git a/tests/amhello-binpkg.test b/tests/amhello-binpkg.test
index 34dc519..f11421f 100755
--- a/tests/amhello-binpkg.test
+++ b/tests/amhello-binpkg.test
@@ -28,8 +28,8 @@ gzip -dc amhello-1.0.tar.gz | tar xf -
 cd amhello-1.0
 
 ./configure --prefix /usr
-make
-make DESTDIR="`pwd`/inst" install
+$MAKE
+$MAKE DESTDIR="`pwd`/inst" install
 cd inst
 find . -type f -print > ../files.lst
 tar cvf amhello-1.0-i686.tar.gz `cat ../files.lst` > tar.got 2>&1
-- 
1.7.2.3




reply via email to

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