Julien Cristau <[email protected]> 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 ([email protected]) <http://www.eyrie.org/~eagle/>
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]