changeset 32883:7b3a242d1270

maint.mk: print better diagnostic when there is no $(_hv_file) * top/maint.mk (sc_cross_check_PATH_usage_in_tests): Skip test and announce that when $(_hv_file) (aka help-version) does not exist.
author Jim Meyering <meyering@redhat.com>
date Fri, 09 Apr 2010 22:36:26 +0200
parents c057981d5b6c
children f0d9e4b38c5f
files ChangeLog top/maint.mk
diffstat 2 files changed, 16 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Apr 09 20:53:49 2010 +0200
+++ b/ChangeLog	Fri Apr 09 22:36:26 2010 +0200
@@ -1,5 +1,9 @@
 2010-04-09  Jim Meyering  <meyering@redhat.com>
 
+	maint.mk: print better diagnostic when there is no $(_hv_file)
+	* top/maint.mk (sc_cross_check_PATH_usage_in_tests): Skip test and
+	announce that when $(_hv_file) (aka help-version) does not exist.
+
 	init.sh: run tr in the "C" locale to avoid multibyte interpretation
 	* tests/init.sh (rand_bytes_): Run tr in the "C" locale so it does
 	not try to interpret its random input bytes.  Jarno Rajahalme reported
--- a/top/maint.mk	Fri Apr 09 20:53:49 2010 +0200
+++ b/top/maint.mk	Fri Apr 09 22:36:26 2010 +0200
@@ -859,14 +859,18 @@
 _hv_file ?= $(srcdir)/tests/help-version
 _hv_regex ?= ^ *\. [^ ]*/init\.sh
 sc_cross_check_PATH_usage_in_tests:
-	@if grep -l 'VERSION mismatch' $(_hv_file) >/dev/null		\
-	    && grep -lE '$(_hv_regex)' $(_hv_file) >/dev/null; then	\
-	  good=$$(grep -E '$(_hv_regex)' < $(_hv_file));		\
-	  grep -LFx "$$good"						\
-		$$(grep -lE '$(_hv_regex)' $$($(VC_LIST_EXCEPT)))	\
-	      | grep . &&						\
-	    { echo "$(ME): the above files use path_prepend_ inconsistently" \
-		1>&2; exit 1; } || :;					\
+	@if test -f $(_hv_file); then					\
+	  if grep -l 'VERSION mismatch' $(_hv_file) >/dev/null		\
+	      && grep -lE '$(_hv_regex)' $(_hv_file) >/dev/null; then	\
+	    good=$$(grep -E '$(_hv_regex)' < $(_hv_file));		\
+	    grep -LFx "$$good"						\
+		  $$(grep -lE '$(_hv_regex)' $$($(VC_LIST_EXCEPT)))	\
+		| grep . &&						\
+	      { echo "$(ME): the above files use path_prepend_ inconsistently" \
+		  1>&2; exit 1; } || :;					\
+	  fi;								\
+	else								\
+	  echo "$@: skipped: no such file: $(_hv_file)";		\
 	fi
 
 # #if HAVE_... will evaluate to false for any non numeric string.