diff top/maint.mk @ 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 837c718e0708
children ef132cd978fc
line wrap: on
line diff
--- a/top/maint.mk	Sun Mar 28 19:39:32 2010 +0200
+++ b/top/maint.mk	Fri Mar 26 09:04:29 2010 +0100
@@ -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