changeset 13085:fb5165836aea

maint.mk: prohibit use of test's -o and -a operators * top/maint.mk (sc_prohibit_test_minus_ao): New rule.
author Jim Meyering <meyering@redhat.com>
date Fri, 26 Mar 2010 09:04:29 +0100
parents f63151a28b7d
children 538b96cce54a
files ChangeLog top/maint.mk
diffstat 2 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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.
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -593,6 +593,14 @@
 	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