Permalink
Browse files

(doh!) make gitolite.pm easier for packagers

should have done this long ago...
  • Loading branch information...
sitaramc committed Oct 23, 2010
1 parent cb0a9bd commit 66b65e5e1db512e695588f326f7339fb5d5a7478
Showing with 17 additions and 8 deletions.
  1. +3 −1 contrib/adc/gl-reflog
  2. +2 −1 contrib/gitweb/gitweb.conf
  3. +2 −1 hooks/common/update
  4. +2 −1 src/gl-auth-command
  5. +2 −1 src/gl-compile-conf
  6. +2 −1 src/gl-install
  7. +2 −1 src/gl-setup-authkeys
  8. +2 −1 src/gl-time
View
@@ -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/;
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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";
# ---------------------------------------------------------------

0 comments on commit 66b65e5

Please sign in to comment.