[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#534580: lintian: false positive in trap bashism check



Julien Cristau <jcristau@debian.org> writes:

> lintian complains about bashisms in some X maintainer scripts, because
> they include the following code:
>
> trap "message;\
>       message \"Received signal.  Aborting $THIS_PACKAGE package $THIS_SCRIPT script.\";\
>       message;\
>       exit 1" HUP INT QUIT TERM
>
> This seems to be due to the trap check:
>     $LEADIN . qr'trap\s+["\']?.*["\']?\s+.*[1-9]', # trap with signal numbers

Ah, yes.  This is where regexes try a bit too hard to make a match.

    trap\s+(?:([\"\'])(?:[^\'\\]|\\.)*\1\s+)?[\"\']*[1-9]

will work a bit better, I think, although I haven't run that through a
test suite.

Interestingly, though, I can't duplicate this.  That regex does not
appear to match that string so far as I can tell from some experiments.
Maybe I messed something up....

-- 
Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>



Reply to: