Bug#463476: checkbashisms: fails to detect shell wrappers
Package: lintian
Version: 1.23.42
Tags: patch
X-Debbugs-Cc: pkg-devscripts@teams.debian.net
On Wed, 2008-01-30 at 10:30 -0800, Russ Allbery wrote:
> Raphael Geissert <atomo64+debian@gmail.com> writes:
>
> > This sounds more like a report against checkbashisms.
> > I guess it could try to detect these:
>
> See script_is_evil_and_wrong() in lintian's check/scripts.
Whilst pinching^Wincorporating script_is_evil_and_wrong() in to
checkbashisms, I noticed that it doesn't catch the former of the two
cases below, due to the use of $* rather than $@. The attached patch
matches both versions.
exec guile -s $0 $*
!#
exec rep "$0" "$@"
!#;; Source file: sawfish-client.jl
Regards,
Adam
--- scripts.orig 2008-01-31 20:25:14.000000000 +0000
+++ scripts 2008-01-31 20:39:26.000000000 +0000
@@ -683,7 +683,7 @@
next if /^#/o;
next if /^$/o;
last if (++$i > 20);
- if (/(^\s*|\beval\s*\'|;)exec\s*.+\s*.?\$0.?\s*(--\s*)?(\${1:?\+)?.?\$\@/o) {
+ if (/(^\s*|\beval\s*\'|;)exec\s*.+\s*.?\$0.?\s*(--\s*)?(\${1:?\+)?.?\$(@|\*)/o) {
$ret = 1;
last;
}
Reply to: