diff options
author | 2020-04-18 08:50:55 +0530 | |
---|---|---|
committer | 2020-04-24 06:22:30 +0530 | |
commit | 98d1fc8030490e6a16fafb23695b01dc5bc5f5c9 (patch) | |
tree | 9dce831ad6d2c6c0cc06d7f5365346b438a329b1 | |
parent | propagate *all* ssh-keygen errors (diff) | |
download | gitolite-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-x | install | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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 ); |