From: jocuri%softhome.net <> Date: Thu, 9 Sep 2004 05:47:16 +0000 (+0000) Subject: Patch for bug 211188: Make testing suite check for any #! lines that are not /usr... X-Git-Tag: bugzilla-2.18rc3~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e9a7ede22ae60450dca1620e688d2935f73c8a6;p=thirdparty%2Fbugzilla.git Patch for bug 211188: Make testing suite check for any #! lines that are not /usr/bin/perl; patch by Marc Schumann ; r=vladd, a=justdave. --- diff --git a/t/002goodperl.t b/t/002goodperl.t index 676cd17763..e9726cb8cd 100644 --- a/t/002goodperl.t +++ b/t/002goodperl.t @@ -48,7 +48,7 @@ foreach my $file (@testitems) { $file =~ m/.*\.(.*)/; my $ext = $1; - if ($file_line1 !~ m#/usr/bin/perl#) { + if ($file_line1 !~ m/^#\!/) { ok(1,"$file does not have a shebang"); } else { my $flags; @@ -66,10 +66,14 @@ foreach my $file (@testitems) { next; } - if ($file_line1 =~ m#/usr/bin/perl -$flags#) { - ok(1,"$file uses -$flags"); + if ($file_line1 =~ m#^\#\!/usr/bin/perl\s#) { + if ($file_line1 =~ m#\s-$flags#) { + ok(1,"$file uses standard perl location and -$flags"); + } else { + ok(0,"$file is MISSING -$flags --WARNING"); + } } else { - ok(0,"$file is MISSING -$flags --WARNING"); + ok(0,"$file uses non-standard perl location"); } } }