Re: checks/scripts / checkbashsims updates
"Adam D. Barratt" <adam@adam-barratt.org.uk> writes:
> Please let me know how you'd prefer to handle these, and any such issues
> that arise in future. I'm more than happy to simply provide a list (as
> below), send patches to the list or file bugs against lintian with
> patches.
Either patches to the list or bugs against lintian with a list would be
ideal for me.
> The first issue is from the checkbashisms side:
>
> '(?<!\$)\(\(', # '((' should be '$(('
>
> This will also match constructs such as "if ((foo || bar) && baz)". I've
> tightened the expression in checkbashisms SVN to be '(?<!\$)\(\(.*\)\)'.
Done likewise in Subversion for lintian.
> The second issue that was highlighted is the check for arguments being
> passed to scripts that are sourced (i.e. ". foo bar"). There are a
> number of constructs that the current check flags, which so far as I can
> tell are all legitimate:
>
> . ${sysconfdir}/pop3d; \
> . ${sysconfdir}/pop3d-ssl ; \
> . `dirname $0`/guilt
>
> I've modified the check to:
>
> if (not $found and m/^\s*(\.\s+[^\s;]+\s+([^\s]+))/) {
>
> which allows all of the above. The only problem I've found with it is
> that constructs such as
>
> . `foo bar` `foobar baz`
>
> aren't flagged, but IMHO that's the lesser of two evils.
I assume that you mean [^\s;\`] here instead of only ;. Done similarly in
lintian.
> Finally, script_is_evil_and_wrong() allows ";exec foo" but not "; exec
> foo". I'm assuming this was a simple oversight, as the two forms are
> equivalent.
Added \s* after ; in the regex. Thanks!
--
Russ Allbery (rra@debian.org) <http://www.eyrie.org/~eagle/>
Reply to: