maint.mk: prohibit use of test's -o and -a operators
authorJim Meyering <meyering@redhat.com>
Fri, 26 Mar 2010 08:04:29 +0000 (09:04 +0100)
committerJim Meyering <meyering@redhat.com>
Sun, 28 Mar 2010 18:50:42 +0000 (20:50 +0200)
* top/maint.mk (sc_prohibit_test_minus_ao): New rule.

ChangeLog
top/maint.mk

index 259a811..12e0722 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-03-26  Jim Meyering  <meyering@redhat.com>
+           Eric Blake  <eblake@redhat.com>
+
+       maint.mk: prohibit use of test's -o and -a operators
+       * top/maint.mk (sc_prohibit_test_minus_ao): New rule.
+
 2010-03-28  Bruno Haible  <bruno@clisp.org>
 
        Remove unused GNULIB_XYZ macro definitions.
index 6127c57..d633188 100644 (file)
@@ -593,6 +593,14 @@ sc_prohibit_S_IS_definition:
        msg='do not define S_IS* macros; include <sys/stat.h>'          \
          $(_prohibit_regexp)
 
+_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.
+sc_prohibit_test_minus_ao:
+       @re='\<test .+ -[ao] '                                          \
+       msg='$(_ptm1); $(_ptm2)'                                                \
+         $(_prohibit_regexp)
+
 # Each program that uses proper_name_utf8 must link with one of the
 # ICONV libraries.  Otherwise, some ICONV library must appear in LDADD.
 # The perl -0777 invocation below extracts the possibly-multi-line