From 98d1fc8030490e6a16fafb23695b01dc5bc5f5c9 Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Sat, 18 Apr 2020 08:50:55 +0530 Subject: Install script can now modify shebangs when using a custom perl executable. --- install | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/install b/install index abafdd5..fa6fc26 100755 --- a/install +++ b/install @@ -7,6 +7,7 @@ use warnings; use Getopt::Long; use FindBin; +use Config; # meant to be run from the root of the gitolite tree, one level above 'src' BEGIN { $ENV{GL_BINDIR} = $FindBin::RealBin . "/src"; } @@ -34,6 +35,12 @@ Usage (from gitolite clone directory): Please provide a full path, not a relative path. + ./install -to + to copy the entire 'src' directory to , but will replace + all of the shebangs with the path to . This + is a way to force gitolite to use some perl that is not + installed at /usr/bin/perl. + Simplest use, if $HOME/bin exists and is in $PATH, is: git clone https://github.com/sitaramc/gitolite @@ -76,6 +83,12 @@ if ($to) { _mkdir($to); system("cp -RpP * $to"); _print( "$to/VERSION", $version ); + + # Replace shebangs if necessary. + my $thisperl = $Config{perlpath}; + if ($thisperl ne '/usr/bin/perl') { + system("cd $to; grep -r -l /usr/bin/perl | xargs perl -pi -e 's(^#!/usr/bin/perl)(#!$thisperl)'"); + } } elsif ($ln) { ln_sf( $ENV{GL_BINDIR}, "gitolite", $ln ); _print( "VERSION", $version ); -- cgit v1.2.3-65-gdbad