[Rt-commit] [rtir] 01/01: Don't hardcode the system perl

Kevin Falcone falcone at bestpractical.com
Wed May 1 10:03:25 EDT 2013


This is an automated email from the git hooks/post-receive script.

falcone pushed a commit to branch 2.9/stop-inline-substitution
in repository rtir.

commit a92d2ef0f2b05f773a6ebb83fd8d48b15c5fa369
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Wed May 1 08:31:09 2013 -0400

    Don't hardcode the system perl
    
    Since we're updating these files to use .in files and avoid the library
    churn dance, also switch to using the perl you used to run Makefile.PL
---
 Makefile.PL               | 9 +++++++++
 etc/add_constituency.in   | 3 ++-
 etc/upgrade/upgrade.pl.in | 3 ++-
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/Makefile.PL b/Makefile.PL
index 6d9ab35..afc6dc6 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -12,6 +12,14 @@ my ($lib_path) = $INC{'RT.pm'} =~ /^(.*)[\\\/]/;
 my $local_lib_path = "$RT::LocalPath/lib";
 unshift @INC, $local_lib_path, $lib_path;
 
+# Straight from perldoc perlvar
+use Config;
+my $secure_perl_path = $Config{perlpath};
+if ($^O ne 'VMS') {
+    $secure_perl_path .= $Config{_exe}
+    unless $secure_perl_path =~ m/$Config{_exe}$/i;
+}
+
 # RTIR needs this version of SB because of cud-from-select
 requires('DBIx::SearchBuilder', 1.61);
 
@@ -33,6 +41,7 @@ auto_install();
 
 substitute( {
         RT_LIB_PATH => join( ' ', $local_lib_path, $lib_path ),
+        PERL        => $ENV{PERL} || $secure_perl_path,
     },
     { sufix => '.in' },
     'etc/upgrade/upgrade.pl',
diff --git a/etc/add_constituency.in b/etc/add_constituency.in
index 15e47dc..476137b 100644
--- a/etc/add_constituency.in
+++ b/etc/add_constituency.in
@@ -1,4 +1,5 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
+### before: #!@PERL@
 
 =head1 NAME
 
diff --git a/etc/upgrade/upgrade.pl.in b/etc/upgrade/upgrade.pl.in
index 6c7e2d4..a91aab6 100644
--- a/etc/upgrade/upgrade.pl.in
+++ b/etc/upgrade/upgrade.pl.in
@@ -1,4 +1,5 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
+### before: #!@PERL@
 # BEGIN BPS TAGGED BLOCK {{{
 #
 # COPYRIGHT:

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Rt-commit mailing list