]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Patch for bug 211188: Make testing suite check for any #! lines that are not /usr...
authorjocuri%softhome.net <>
Thu, 9 Sep 2004 05:47:16 +0000 (05:47 +0000)
committerjocuri%softhome.net <>
Thu, 9 Sep 2004 05:47:16 +0000 (05:47 +0000)
t/002goodperl.t

index 676cd177632744a6e8ac3a6803dbc487dde859cb..e9726cb8cd9c97a7d78943f353e7cc7f5c4fd317 100644 (file)
@@ -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");
         }
     }
 }