On 11/13/2010 11:31 AM, Paolo Bonzini wrote: > On 11/13/2010 07:10 PM, Eric Blake wrote: >> Maybe a compromise would be to revert this, but to tighten the prohibit >> regex: >> >> prohibit='(\<test| \[+) ("[^"]*"|[^ ]+) == ' >> >> which misses out on both false positives in coreutils, but still detects >> the libvirt bug? > > Or the shell syntax checks' $containing could be set with a makefile > variable (defaulting to ^#! */bin/sh but overridable by libvirt).
Hmm; that particular libvirt file includes the string #!/bin/bash, but also part of a string constant being written to a temporary shell script file. So allowing an override of the prohibit string would do the trick; but for now, it's even easier to just change it. (Double-hmm - that means that libvirt file is technically immune to the very problem I'm trying to detect, since it requires bash and bash supports test ==; but I really want to convert that file to work with any /bin/sh rather than requiring bash). Here's what I'll push: From 085dcf3490d16a18f8f2d41c46c856ddaa7a2e79 Mon Sep 17 00:00:00 2001 From: Eric Blake <ebl...@redhat.com> Date: Sat, 13 Nov 2010 13:44:07 -0700 Subject: [PATCH] maintainer-makefile: cover a few more files * top/maint.mk (sc_prohibit_test_double_equal): Also cover shell scripts generated within C files, for libvirt. Signed-off-by: Eric Blake <ebl...@redhat.com> --- ChangeLog | 6 ++++++ top/maint.mk | 2 +- 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/ChangeLog b/ChangeLog index fe84ead..97cebc2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-11-13 Eric Blake <ebl...@redhat.com> + + maintainer-makefile: cover a few more files + * top/maint.mk (sc_prohibit_test_double_equal): Also cover shell + scripts generated within C files, for libvirt. + 2010-11-13 Bruno Haible <br...@clisp.org> unistr/u8-mbtouc: Improve handling of ill-formed UTF-8 input. diff --git a/top/maint.mk b/top/maint.mk index 65c2f80..2c1be85 100644 --- a/top/maint.mk +++ b/top/maint.mk @@ -820,7 +820,7 @@ sc_prohibit_test_minus_ao: # Avoid a test bashism. sc_prohibit_test_double_equal: @prohibit='(\<test| \[+) .+ == ' \ - containing='^#! */bin/sh' \ + containing='#! */bin/[a-z]*sh' \ halt='use "test x = x", not "test x =''= x"' \ $(_sc_search_regexp) -- 1.7.3.2 -- Eric Blake ebl...@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature