(doh!) make gitolite.pm easier for packagers

should have done this long ago...
This commit is contained in:
Sitaram Chamarty 2010-10-23 16:43:47 +05:30
parent cb0a9bdb0c
commit 66b65e5e1d
8 changed files with 17 additions and 8 deletions

View file

@ -33,7 +33,9 @@ use warnings;
my($cmd, $repo, $ref, $limit) = @ARGV;
$limit ||= 10;
require "$ENV{GL_BINDIR}/gitolite.pm" or die "parse gitolite.pm failed\n";
unshift @INC, $ENV{GL_BINDIR};
require gitolite or die "parse gitolite.pm failed\n";
my ($perm, $creator, $wild) = &repo_rights($repo);
die "you don't have read access to $repo\n" unless $perm =~ /R/;

View file

@ -25,7 +25,8 @@ $ENV{GL_REPO_BASE_ABS} = ( $REPO_BASE =~ m(^/) ? $REPO_BASE : "$gl_home/$REPO_BA
$projects_list = $projectroot = $ENV{GL_REPO_BASE_ABS};
# load gitolite helper routines
require "$GL_ADMINDIR/src/gitolite.pm"
unshift @INC, "$GL_ADMINDIR/src";
require gitolite
or die_error(500, "Failed to parse gitolite.pm: " . ($! or $@));
$export_auth_hook = sub {

View file

@ -35,7 +35,8 @@ exit 0 if exists $ENV{GL_BYPASS_UPDATE_HOOK};
# we should already have the GL_RC env var set when we enter this hook
die "parse $ENV{GL_RC} failed: " . ($! or $@) unless do $ENV{GL_RC};
require "$ENV{GL_BINDIR}/gitolite.pm";
unshift @INC, $ENV{GL_BINDIR};
require gitolite or die "parse gitolite.pm failed\n";
my ($perm, $creator, $wild) = &repo_rights($ENV{GL_REPO});
my $reported_repo = $ENV{GL_REPO} . ( $ENV{GL_REPOPATT} ? " ($ENV{GL_REPOPATT})" : "" );

View file

@ -43,7 +43,8 @@ our %repo_config;
my $bindir = $0;
$bindir =~ s/\/[^\/]+$//;
$bindir = "$ENV{PWD}/$bindir" unless $bindir =~ /^\//;
require "$bindir/gitolite.pm";
unshift @INC, $bindir;
require gitolite or die "parse gitolite.pm failed\n";
# ask where the rc file is, get it, and "do" it
&where_is_rc();

View file

@ -60,7 +60,8 @@ our ($REPONAME_PATT, $REPOPATT_PATT, $USERNAME_PATT, $ABRT, $WARN);
my $bindir = $0;
$bindir =~ s/\/[^\/]+$//;
$bindir = "$ENV{PWD}/$bindir" unless $bindir =~ /^\//;
require "$bindir/gitolite.pm";
unshift @INC, $bindir;
require gitolite or die "parse gitolite.pm failed\n";
# ask where the rc file is, get it, and "do" it
&where_is_rc();

View file

@ -28,7 +28,8 @@ sub wrap_mkdir
# the common setup module is in the same directory as this running program is
my $bindir = $0;
$bindir =~ s/\/[^\/]+$//;
require "$bindir/gitolite.pm";
unshift @INC, $bindir;
require gitolite or die "parse gitolite.pm failed\n";
# ask where the rc file is, get it, and "do" it
&where_is_rc();

View file

@ -30,7 +30,8 @@ our ($GL_PERFLOGT);
my $bindir = $0;
$bindir =~ s/\/[^\/]+$//;
$bindir = "$ENV{PWD}/$bindir" unless $bindir =~ /^\//;
require "$bindir/gitolite.pm";
unshift @INC, $bindir;
require gitolite or die "parse gitolite.pm failed\n";
# prevent newbie from running it accidentally and clobbering his authkeys
# file!

View file

@ -22,7 +22,8 @@ do "$ENV{HOME}/.gitolite.rc";
my $bindir = $0;
$bindir =~ s/\/[^\/]+$//;
$bindir = "$ENV{PWD}/$bindir" unless $bindir =~ /^\//;
require "$bindir/gitolite.pm";
unshift @INC, $bindir;
require gitolite or die "parse gitolite.pm failed\n";
# ---------------------------------------------------------------