On Mon, Sep 18, 2023 at 12:22:37PM +0200, Erik Skultety wrote: > 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. Therefore, drop the > rule. The link above has an annotation against -a and -o which says "[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." In practice I'm skeptical any shell is going to remove this, even if POSIX removed it, because it would break about $bazillion user scripts in the wild. IOW, I don't mind dropping this blocking rule, but please update the commit message to say we don't care that it is obsolescent in POSIX. Reviewed-by: Daniel P. Berrangé <berrange@xxxxxxxxxx> > > Signed-off-by: Erik Skultety <eskultet@xxxxxxxxxx> > --- > build-aux/syntax-check.mk | 9 --------- > 1 file changed, 9 deletions(-) > > diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk > index d7cf109fbd..5718768193 100644 > --- a/build-aux/syntax-check.mk > +++ b/build-aux/syntax-check.mk > @@ -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| \[+) .+ == ' \ > -- > 2.41.0 > With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|