changeset 13101:8dad7d30953c

maint.mk: check for [ as well as test A word on the regex: \<\[ never matches, so the match instead looks for a leading space in that case. Although configure.ac should generally use test instead of [ (because the latter has to be spelled [[ because of m4 processing), libvirt had a case of the latter that would have been detected with this rule. * top/maint.mk (sc_prohibit_test_minus_ao): Extend test. Based on a libvirt report by Matthias Bolte. Signed-off-by: Eric Blake <eblake@redhat.com>
author Eric Blake <eblake@redhat.com>
date Wed, 31 Mar 2010 15:33:55 -0600
parents 61dece5578fb
children 9c58202271c4
files ChangeLog top/maint.mk
diffstat 2 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2010-03-31  Eric Blake  <eblake@redhat.com>
 
+	maint.mk: check for [ as well as test
+	* top/maint.mk (sc_prohibit_test_minus_ao): Extend test.
+	Based on a libvirt report by Matthias Bolte.
+
 	gnumakefile: don't squelch _version output
 	* top/GNUmakefile (_version): Create one-shot dependency rather
 	than using $(shell) when version must be regenerated.
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -597,9 +597,10 @@
 _ptm1 = use "test C1 && test C2", not "test C1 -''a C2"
 _ptm2 = use "test C1 || test C2", not "test C1 -''o C2"
 # Using test's -a and -o operators is not portable.
+# We prefer test over [, since the latter is spelled [[ in configure.ac.
 sc_prohibit_test_minus_ao:
-	@re='\<test .+ -[ao] '						\
-	msg='$(_ptm1); $(_ptm2)'						\
+	@re='(\<test| \[+) .+ -[ao] '					\
+	msg='$(_ptm1); $(_ptm2)'					\
 	  $(_prohibit_regexp)
 
 # Each program that uses proper_name_utf8 must link with one of the