OK for maint?

Regards,
   Stefano

-*-*-*-

[PATCH 1/2] New maintainer check, for typos in $required definition.

* Makefile.am (sc_tests_required_typos): New maintaner check.
(syntax_check_rules): Updated.
From a report by Peter Rosin.
---
 ChangeLog   |    7 +++++++
 Makefile.am |    9 +++++++++
 Makefile.in |    8 ++++++++
 3 files changed, 24 insertions(+), 0 deletions(-)

-*-*-*-

[PATCH 2/2] Fix some spurious maintainer-check failures (exit vs. 
Exit).

* Makefile.am (sc_tests_Exit_not_exit): Fixed spurious failures,
and other minor improvements.
---
 ChangeLog   |    4 ++++
 Makefile.am |   17 +++++++++++++----
 Makefile.in |   14 +++++++++++---
 3 files changed, 28 insertions(+), 7 deletions(-)

From 2564e752f0d0faa9af2351704cc120ffe14e01cb Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <stefano.lattar...@gmail.com>
Date: Thu, 16 Sep 2010 12:32:43 +0200
Subject: [PATCH 1/2] New maintainer check, for typos in $required definition.

* Makefile.am (sc_tests_required_typos): New maintaner check.
(syntax_check_rules): Updated.
From a report by Peter Rosin.
---
 ChangeLog   |    7 +++++++
 Makefile.am |    9 +++++++++
 Makefile.in |    8 ++++++++
 3 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7b64d55..950eafc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-09-16  Stefano Lattarini  <stefano.lattar...@gmail.com>
+
+	New maintainer check, for typos in $required definition.
+	* Makefile.am (sc_tests_required_typos): New maintaner check.
+	(syntax_check_rules): Updated.
+	From a report by Peter Rosin.
+
 2010-09-13  Ralf Wildenhues  <ralf.wildenh...@gmx.de>
 
 	* HACKING: Hint at old commits with `git describe' output.
diff --git a/Makefile.am b/Makefile.am
index 3aead75..7921181 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -136,6 +136,7 @@ sc_tests_Exit_not_exit \
 sc_tests_automake_fails \
 sc_tests_plain_aclocal \
 sc_tests_plain_perl \
+sc_tests_required_typos \
 sc_tests_required_after_defs \
 sc_tests_overriding_macros_on_cmdline \
 sc_tests_plain_sleep \
@@ -358,6 +359,14 @@ sc_tests_plain_perl:
 	  exit 1; \
 	fi
 
+## Look for common typos in the definition of `$required'.
+sc_tests_required_typos:
+	@if grep -v '^#' $(srcdir)/tests/*.test | grep -E '\brequires?='; then \
+	  echo 'In the above tests, to declare required tools, you want' 1>&2; \
+	  echo 'to define $$required, not $$require or $$requires' 1>&2; \
+	  exit 1; \
+	fi
+
 ## Setting `required' after sourcing `./defs' is a bug.
 sc_tests_required_after_defs:
 	@for file in $(srcdir)/tests/*.test; do \
diff --git a/Makefile.in b/Makefile.in
index 528b80e..48fa893 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -294,6 +294,7 @@ sc_tests_Exit_not_exit \
 sc_tests_automake_fails \
 sc_tests_plain_aclocal \
 sc_tests_plain_perl \
+sc_tests_required_typos \
 sc_tests_required_after_defs \
 sc_tests_overriding_macros_on_cmdline \
 sc_tests_plain_sleep \
@@ -1048,6 +1049,13 @@ sc_tests_plain_perl:
 	  exit 1; \
 	fi
 
+sc_tests_required_typos:
+	@if grep -v '^#' $(srcdir)/tests/*.test | grep -E '\brequires?='; then \
+	  echo 'In the above tests, to declare required tools, you want' 1>&2; \
+	  echo 'to define $$required, not $$require or $$requires' 1>&2; \
+	  exit 1; \
+	fi
+
 sc_tests_required_after_defs:
 	@for file in $(srcdir)/tests/*.test; do \
 	  if out=`sed -n '/defs/,$${/required=/p;}' $$file`; test -n "$$out"; then \
-- 
1.7.1

From 2a3599a35af99609eaf7d627f2fcd5852aa20ec8 Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <stefano.lattar...@gmail.com>
Date: Thu, 16 Sep 2010 13:11:46 +0200
Subject: [PATCH 2/2] Fix some spurious maintainer-check failures (exit vs. Exit).

* Makefile.am (sc_tests_Exit_not_exit): Fixed spurious failures,
and other minor improvements.
---
 ChangeLog   |    4 ++++
 Makefile.am |   17 +++++++++++++----
 Makefile.in |   14 +++++++++++---
 3 files changed, 28 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 950eafc..1b7e738 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2010-09-16  Stefano Lattarini  <stefano.lattar...@gmail.com>
 
+	Fix some spurious maintainer-check failures (exit vs. Exit).
+	* Makefile.am (sc_tests_Exit_not_exit): Fixed spurious failures,
+	and other minor improvements.
+
 	New maintainer check, for typos in $required definition.
 	* Makefile.am (sc_tests_required_typos): New maintaner check.
 	(syntax_check_rules): Updated.
diff --git a/Makefile.am b/Makefile.am
index 7921181..6d8715a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -323,13 +323,22 @@ sc_tests_here_document_format:
 
 ## Tests should never call exit directly, but use Exit.
 ## This is so that the exit status is transported correctly across the 0 trap.
-## Ignore comments, and ignore one perl line in ext2.test.
+## Ignore comments, one perl line in ext2.test, and some legit uses in
+## generated tests.
 sc_tests_Exit_not_exit:
 	@found=false; for file in $(srcdir)/tests/*.test; do \
-	  res=`sed -n -e '/^#/d; /^\$$PERL/d' -e '/<<.*END/,/^END/b' \
-		      -e '/<<.*EOF/,/^EOF/b' -e '/exit [$$0-9]/p' $$file`; \
+	  res=`sed -n -e '/^#/d' -e '/<<.*END/,/^END/b' -e '/<<.*EOF/,/^EOF/b' \
+	              -e '/exit [$$0-9]/p' $$file`; \
+	  case $$file in\
+	    */ext2.test) \
+	      res=`printf '%s\n' "$$res" | grep -v '^ *\$$PERL '`;; \
+	    *-p.test) \
+	      res=`printf '%s\n' "$$res" \
+	        | grep -v '^\. \./defs || exit 99 *$$' \
+		| grep -v '^test -n "\$$srcdir" || exit 99'`;; \
+	  esac; \
 	  if test -n "$$res"; then \
-	    echo "$$file:$$res"; \
+	    printf '%s\n' "$$res" | sed "s|^|$$file:|"; \
 	    found=true; \
 	  fi; \
 	done; \
diff --git a/Makefile.in b/Makefile.in
index 48fa893..aa3087a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1019,10 +1019,18 @@ sc_tests_here_document_format:
 
 sc_tests_Exit_not_exit:
 	@found=false; for file in $(srcdir)/tests/*.test; do \
-	  res=`sed -n -e '/^#/d; /^\$$PERL/d' -e '/<<.*END/,/^END/b' \
-		      -e '/<<.*EOF/,/^EOF/b' -e '/exit [$$0-9]/p' $$file`; \
+	  res=`sed -n -e '/^#/d' -e '/<<.*END/,/^END/b' -e '/<<.*EOF/,/^EOF/b' \
+	              -e '/exit [$$0-9]/p' $$file`; \
+	  case $$file in\
+	    */ext2.test) \
+	      res=`printf '%s\n' "$$res" | grep -v '^ *\$$PERL '`;; \
+	    *-p.test) \
+	      res=`printf '%s\n' "$$res" \
+	        | grep -v '^\. \./defs || exit 99 *$$' \
+		| grep -v '^test -n "\$$srcdir" || exit 99'`;; \
+	  esac; \
 	  if test -n "$$res"; then \
-	    echo "$$file:$$res"; \
+	    printf '%s\n' "$$res" | sed "s|^|$$file:|"; \
 	    found=true; \
 	  fi; \
 	done; \
-- 
1.7.1

Reply via email to