[Bps-public-commit] r10880 - Shipwright/trunk/lib/Shipwright

sunnavy at bestpractical.com sunnavy at bestpractical.com
Tue Feb 19 12:14:55 EST 2008


Author: sunnavy
Date: Tue Feb 19 12:14:48 2008
New Revision: 10880

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

Log:
we don't need to substitute %%PERL%% before perl is installed.

Modified: Shipwright/trunk/lib/Shipwright/Backend.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Backend.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Backend.pm	Tue Feb 19 12:14:48 2008
@@ -481,12 +481,18 @@
     my $text = shift;
     return unless $text;
 
-    my $perl          = $args{'perl'} || $^X;
-    my $perl_archname = `$perl -MConfig -e 'print \$Config{archname}'`;
-    my $install_base  = $args{'install-base'};
-    $text =~ s/%%PERL%%/$perl/g;
-    $text =~ s/%%PERL_ARCHNAME%%/$perl_archname/g;
+    my $install_base  = $args{'install-base'}; 
     $text =~ s/%%INSTALL_BASE%%/$install_base/g;
+    
+    my $perl = $args{'perl'} || $^X;
+
+    if ( -e $perl ) {
+        # we only need to substitute below stuff if $perl exists;
+        my $perl_archname = `$perl -MConfig -e 'print \$Config{archname}'`;
+        $text =~ s/%%PERL%%/$perl/g;
+        $text =~ s/%%PERL_ARCHNAME%%/$perl_archname/g;
+    }
+    
     return $text;
 }
 



More information about the Bps-public-commit mailing list