Re: [SCM] Debian package checker branch, master, updated. 2.1.3-60-gd6ac8bf
On Fri, 2009-01-02 at 18:47 +0000, Adam D. Barratt wrote:
> The following commit has been merged in the master branch:
> commit d6ac8bf38340dae035d62880930a77fb1b6129bc
> Author: Adam D. Barratt <adam@adam-barratt.org.uk>
> Date: Fri Jan 2 18:47:04 2009 +0000
>
> Flag the source bashism when its argument is quoted.
On a related note, a recent bug report against checkbashisms noted that
we don't flag "source foo" as a bashism; predictably enough, nor does
lintian.
We currently allow commands of the forms:
source ./foo
source /foo/bar
source $foo
There are two reasons I can think of for those restrictions (although I
may have missed some):
1) It's the set required by SUS for "." (well, the third isn't, but we
can't know what $foo contains). Which is fine, but not necessarily that
useful when trying to find bashisms. :-)
2) Avoiding false positives such as "echo Retrieving source of $foo".
These should now mostly be avoided by the use of $LEADIN.
Assuming the above is correct, is there any reason we shouldn't change
the test from the current
$LEADIN . qr'source\s+[\"\']?(?:\.\/|\/|\$)[^\s]+'
to something more along the lines of
$LEADIN . qr'source\s+[\"\']?(?:\.\/|\/|\$|[\w.-])[^\s]+'
?
Adam
Reply to: