]> xenbits.xensource.com Git - libvirt.git/commitdiff
syntax-check: Drop the shell's 'check for minus' rule
authorErik Skultety <eskultet@redhat.com>
Fri, 27 Jan 2023 07:52:17 +0000 (08:52 +0100)
committerErik Skultety <eskultet@redhat.com>
Tue, 19 Sep 2023 11:35:58 +0000 (13:35 +0200)
Apparently we've only had it because the -[ao] options weren't portable
at the time, but according to
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html

both are defined in POSIX.1-2017 revision which is old enough for all
our supported platforms to have adopted it already, so we can drop the
check. However, the above has also marked -[ao] as obsolescent stating
that:
   "[OB] Obsolescent

   The functionality described may be removed in a future version of
   this volume of POSIX.1-2017. Strictly Conforming POSIX Applications
   and Strictly Conforming XSI Applications shall not use obsolescent
   features."

It is however unlikely that the shell implementations would drop
support for -[ao] despite POSIX potentially removing them.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
build-aux/syntax-check.mk

index d7cf109fbd35f8c13d3b5b6cf606b85e9457b3e6..5718768193be935abb8d7dc23845b5aa4c91998d 100644 (file)
@@ -1201,15 +1201,6 @@ sc_prohibit_double_semicolon:
        halt="Double semicolon detected" \
          $(_sc_search_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.
-# We prefer test over [, since the latter is spelled [[ in configure.ac.
-sc_prohibit_test_minus_ao:
-       @prohibit='(\<test| \[+) .+ -[ao] ' \
-       halt='$(_ptm1); $(_ptm2)' \
-         $(_sc_search_regexp)
-
 # Avoid a test bashism.
 sc_prohibit_test_double_equal:
        @prohibit='(\<test| \[+) .+ == ' \