[Bps-public-commit] r10677 - bpsbuilder/Shipwright/lib/Shipwright

sunnavy at bestpractical.com sunnavy at bestpractical.com
Sat Feb 2 15:21:00 EST 2008


Author: sunnavy
Date: Sat Feb  2 15:20:57 2008
New Revision: 10677

Modified:
   bpsbuilder/Shipwright/lib/Shipwright/Backend.pm

Log:
handle the "/usr/bin/env perl" or alike shebang line when symlink

Modified: bpsbuilder/Shipwright/lib/Shipwright/Backend.pm
==============================================================================
--- bpsbuilder/Shipwright/lib/Shipwright/Backend.pm	(original)
+++ bpsbuilder/Shipwright/lib/Shipwright/Backend.pm	Sat Feb  2 15:20:57 2008
@@ -421,11 +421,14 @@
         if ( -T $file ) {
             open my $fh, '<', $file or die "can't open $file: $!";
             my $shebang = <$fh>;
-            if ( $shebang =~
-m{\Q$args{'install-base'}\E(?:/|\\)(?:s?bin|libexec)(?:/|\\)(\w+)}
+            if (
+                $shebang =~ m{
+\Q$args{'install-base'}\E(?:/|\\)(?:s?bin|libexec)(?:/|\\)(\w+)
+|\benv\s+(\w+)
+}x
               )
             {
-                $type = $1;
+                $type = $1 || $2;
             }
         }
 



More information about the Bps-public-commit mailing list