Skip to content

Commit

Permalink
(doh!) make gitolite.pm easier for packagers
Browse files Browse the repository at this point in the history
should have done this long ago...
  • Loading branch information
sitaramc committed Oct 23, 2010
1 parent cb0a9bd commit 66b65e5
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 8 deletions.
4 changes: 3 additions & 1 deletion contrib/adc/gl-reflog
Expand Up @@ -33,7 +33,9 @@ use warnings;
my($cmd, $repo, $ref, $limit) = @ARGV; my($cmd, $repo, $ref, $limit) = @ARGV;
$limit ||= 10; $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); my ($perm, $creator, $wild) = &repo_rights($repo);
die "you don't have read access to $repo\n" unless $perm =~ /R/; die "you don't have read access to $repo\n" unless $perm =~ /R/;


Expand Down
3 changes: 2 additions & 1 deletion contrib/gitweb/gitweb.conf
Expand Up @@ -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}; $projects_list = $projectroot = $ENV{GL_REPO_BASE_ABS};


# load gitolite helper routines # 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 $@)); or die_error(500, "Failed to parse gitolite.pm: " . ($! or $@));


$export_auth_hook = sub { $export_auth_hook = sub {
Expand Down
3 changes: 2 additions & 1 deletion hooks/common/update
Expand Up @@ -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 # 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}; 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 ($perm, $creator, $wild) = &repo_rights($ENV{GL_REPO});
my $reported_repo = $ENV{GL_REPO} . ( $ENV{GL_REPOPATT} ? " ($ENV{GL_REPOPATT})" : "" ); my $reported_repo = $ENV{GL_REPO} . ( $ENV{GL_REPOPATT} ? " ($ENV{GL_REPOPATT})" : "" );
Expand Down
3 changes: 2 additions & 1 deletion src/gl-auth-command
Expand Up @@ -43,7 +43,8 @@ our %repo_config;
my $bindir = $0; my $bindir = $0;
$bindir =~ s/\/[^\/]+$//; $bindir =~ s/\/[^\/]+$//;
$bindir = "$ENV{PWD}/$bindir" unless $bindir =~ /^\//; $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 # ask where the rc file is, get it, and "do" it
&where_is_rc(); &where_is_rc();
Expand Down
3 changes: 2 additions & 1 deletion src/gl-compile-conf
Expand Up @@ -60,7 +60,8 @@ our ($REPONAME_PATT, $REPOPATT_PATT, $USERNAME_PATT, $ABRT, $WARN);
my $bindir = $0; my $bindir = $0;
$bindir =~ s/\/[^\/]+$//; $bindir =~ s/\/[^\/]+$//;
$bindir = "$ENV{PWD}/$bindir" unless $bindir =~ /^\//; $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 # ask where the rc file is, get it, and "do" it
&where_is_rc(); &where_is_rc();
Expand Down
3 changes: 2 additions & 1 deletion src/gl-install
Expand Up @@ -28,7 +28,8 @@ sub wrap_mkdir
# the common setup module is in the same directory as this running program is # the common setup module is in the same directory as this running program is
my $bindir = $0; my $bindir = $0;
$bindir =~ s/\/[^\/]+$//; $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 # ask where the rc file is, get it, and "do" it
&where_is_rc(); &where_is_rc();
Expand Down
3 changes: 2 additions & 1 deletion src/gl-setup-authkeys
Expand Up @@ -30,7 +30,8 @@ our ($GL_PERFLOGT);
my $bindir = $0; my $bindir = $0;
$bindir =~ s/\/[^\/]+$//; $bindir =~ s/\/[^\/]+$//;
$bindir = "$ENV{PWD}/$bindir" unless $bindir =~ /^\//; $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 # prevent newbie from running it accidentally and clobbering his authkeys
# file! # file!
Expand Down
3 changes: 2 additions & 1 deletion src/gl-time
Expand Up @@ -22,7 +22,8 @@ do "$ENV{HOME}/.gitolite.rc";
my $bindir = $0; my $bindir = $0;
$bindir =~ s/\/[^\/]+$//; $bindir =~ s/\/[^\/]+$//;
$bindir = "$ENV{PWD}/$bindir" unless $bindir =~ /^\//; $bindir = "$ENV{PWD}/$bindir" unless $bindir =~ /^\//;
require "$bindir/gitolite.pm"; unshift @INC, $bindir;
require gitolite or die "parse gitolite.pm failed\n";


# --------------------------------------------------------------- # ---------------------------------------------------------------


Expand Down

0 comments on commit 66b65e5

Please sign in to comment.