Re: List of packages shipping shell scripts with bashisms + MBF proposal
- To: lintian-maint@debian.org
- Cc: pkg-devscripts <pkg-devscripts@teams.debian.net>
- Subject: Re: List of packages shipping shell scripts with bashisms + MBF proposal
- From: "Adam D. Barratt" <adam@adam-barratt.org.uk>
- Date: Thu, 31 Jan 2008 20:46:41 +0000
- Message-id: <[🔎] 1201812401.8958.5.camel@kaa.jungle.aubergine.my-net-space.net>
- In-reply-to: <87zlunjcnt.fsf@windlord.stanford.edu>
- References: <fnolkp$a5u$1@ger.gmane.org> <e13a36b30801291817y4c7ceb63r638968f821c519a4@mail.gmail.com> <20080130023152.GX1240@evy.ikibiki.org> <e13a36b30801300143l7f25ec9do291865ba4b0c6856@mail.gmail.com> <fnq6d2$st8$1@ger.gmane.org> <873asfmak6.fsf@windlord.stanford.edu> <1201722774.19488.7.camel@kaa.jungle.aubergine.my-net-space.net> <87zlunjcnt.fsf@windlord.stanford.edu>
Hi,
On Wed, 2008-01-30 at 12:12 -0800, Russ Allbery wrote:
> "Adam D. Barratt" <adam@adam-barratt.org.uk> writes:
>
> > lintian's parsing code certainly sounds better (mainly because
> > checkbashisms is based on an old version of the lintian code) but, from
> > a quick look, checkbashisms flags more issues than lintian does. We do
> > appear to be missing a few though; I'll have a look at getting them back
> > in sync.
>
> I'd definitely welcome any additional regexes or code to add to lintian.
> (And at some point we can figure out how to keep this in sync with less
> effort.)
Having had chance to compare the two sets of regexes in more detail,
there's (predictably enough) a lot of overlap. The differences are:
Only in checkbashisms:
'(?:^|\s+)select\s+\w+' - 'select' is not POSIX
'\$\{!\w+[@*]\}' - ${!prefix[*|@]}
'\$\{!\w+\}' - ${!name}
'\$\(\([A-Za-z]' - cnt=$((cnt + 1)) does not work in dash
'echo\s+-[e]' - echo -e
'exec\s+-[acl]' - exec -c/-l/-a name
'\blet\s' - let ...
'\$RANDOM\b' - $RANDOM
'(?<!\$)\(\(' - '((' should be '$(('
'(\[|test)\s+-a' - test with unary -a (should be -e)
[Optional as Policy requires it to work]
'echo\s+-[n]' => 'q<echo -n>'
Only in lintian:
'(?:^|\s+)kill\s+-[^sl]\w*' - kill -[0-9] or -[A-Z]
'(?:^|\s+)trap\s+["\']?.*["\']?\s+.*[1-9]' - trap with signal
numbers
'\[\[(?!:)' - alternative test command (i.e. [[ ]] rather than
[ ])
I'm assuming these two are intended to catch the same case:
[checkbashsisms] '\D+(>&|&>)\w+' - should be >word 2>&1
[lintian] '\&>' - cshism
Adam
Reply to: