]> xenbits.xensource.com Git - libvirt.git/commitdiff
maint: add syntax-check rule to prohibit use of test's -a operator
authorJim Meyering <meyering@redhat.com>
Wed, 24 Mar 2010 08:32:43 +0000 (09:32 +0100)
committerJim Meyering <meyering@redhat.com>
Wed, 24 Mar 2010 08:32:43 +0000 (09:32 +0100)
* cfg.mk (sc_prohibit_test_minus_a): New rule.

cfg.mk

diff --git a/cfg.mk b/cfg.mk
index 2d0d278e1492724e88ddc757aa3a7bcfb36d70fa..4302338cc83327d59a4c90c0bebcaa0ac36c1836 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -269,6 +269,12 @@ sc_preprocessor_indentation:
          echo '$(ME): skipping test $@: cppi not installed' 1>&2;      \
        fi
 
+# Using test's -a operator is not portable.
+sc_prohibit_test_minus_a:
+       @re='\<test .+ -[a] '                                           \
+       msg='use "test C1 && test C2, not "test C1 -''a C2"'            \
+         $(_prohibit_regexp)
+
 sc_copyright_format:
        @$(VC_LIST_EXCEPT) | xargs grep -ni 'copyright .*Red 'Hat       \
          | grep -v Inc                                                 \