bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH] maint.mk: check for [ as well as test


From: Eric Blake
Subject: [PATCH] maint.mk: check for [ as well as test
Date: Wed, 31 Mar 2010 15:37:50 -0600

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 <address@hidden>
---

I will be pushing this soon.

 ChangeLog    |    4 ++++
 top/maint.mk |    5 +++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 03d99e7..82263a7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2010-03-31  Eric Blake  <address@hidden>

+       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.
diff --git a/top/maint.mk b/top/maint.mk
index e121eb8..8253e8b 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -597,9 +597,10 @@ sc_prohibit_S_IS_definition:
 _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
-- 
1.6.6.1





reply via email to

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