(doh!) make gitolite.pm easier for packagers
should have done this long ago...
This commit is contained in:
parent
cb0a9bdb0c
commit
66b65e5e1d
|
@ -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/;
|
||||||
|
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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})" : "" );
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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!
|
||||||
|
|
|
@ -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";
|
||||||
|
|
||||||
# ---------------------------------------------------------------
|
# ---------------------------------------------------------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue