aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSitaram Chamarty <sitaramc@gmail.com>2020-04-18 08:50:55 +0530
committerSitaram Chamarty <sitaramc@gmail.com>2020-04-24 06:22:30 +0530
commit98d1fc8030490e6a16fafb23695b01dc5bc5f5c9 (patch)
tree9dce831ad6d2c6c0cc06d7f5365346b438a329b1
parentpropagate *all* ssh-keygen errors (diff)
downloadgitolite-gentoo-98d1fc8030490e6a16fafb23695b01dc5bc5f5c9.tar.gz
gitolite-gentoo-98d1fc8030490e6a16fafb23695b01dc5bc5f5c9.tar.bz2
gitolite-gentoo-98d1fc8030490e6a16fafb23695b01dc5bc5f5c9.zip
Install script can now modify shebangs when using a custom perl executable.
-rwxr-xr-xinstall13
1 files changed, 13 insertions, 0 deletions
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.
+ <perl-executable> ./install -to <dir>
+ to copy the entire 'src' directory to <dir>, but will replace
+ all of the shebangs with the path to <perl-executable>. 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 );