2012-03-16 05:29:45 +01:00
|
|
|
package Gitolite::Rc;
|
|
|
|
|
|
|
|
# everything to do with 'rc'. Also defines some 'constants'
|
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
|
|
|
|
@EXPORT = qw(
|
|
|
|
%rc
|
|
|
|
glrc
|
|
|
|
query_rc
|
2012-03-15 14:44:40 +01:00
|
|
|
version
|
2012-03-19 03:01:09 +01:00
|
|
|
trigger
|
2012-06-09 04:18:56 +02:00
|
|
|
_which
|
2012-03-16 05:29:45 +01:00
|
|
|
|
2012-03-12 16:24:30 +01:00
|
|
|
$REMOTE_COMMAND_PATT
|
2012-03-16 05:29:45 +01:00
|
|
|
$REF_OR_FILENAME_PATT
|
|
|
|
$REPONAME_PATT
|
|
|
|
$REPOPATT_PATT
|
|
|
|
$USERNAME_PATT
|
2012-03-16 09:59:45 +01:00
|
|
|
$UNSAFE_PATT
|
2012-03-16 05:29:45 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
use Exporter 'import';
|
|
|
|
use Getopt::Long;
|
|
|
|
|
|
|
|
use Gitolite::Common;
|
|
|
|
|
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
|
|
|
|
our %rc;
|
|
|
|
|
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
|
2012-04-06 16:59:05 +02:00
|
|
|
# pre-populate some important rc keys
|
2012-03-16 05:29:45 +01:00
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
|
2012-04-18 02:56:18 +02:00
|
|
|
$rc{GL_BINDIR} = $ENV{GL_BINDIR};
|
|
|
|
$rc{GL_LIBDIR} = $ENV{GL_LIBDIR};
|
2012-03-17 16:43:28 +01:00
|
|
|
|
2012-04-06 16:59:05 +02:00
|
|
|
# these keys could be overridden by the rc file later
|
2012-04-18 02:56:18 +02:00
|
|
|
$rc{GL_REPO_BASE} = "$ENV{HOME}/repositories";
|
2012-03-16 05:29:45 +01:00
|
|
|
$rc{GL_ADMIN_BASE} = "$ENV{HOME}/.gitolite";
|
2012-03-17 16:43:28 +01:00
|
|
|
$rc{LOG_TEMPLATE} = "$ENV{HOME}/.gitolite/logs/gitolite-%y-%m.log";
|
2012-03-16 05:29:45 +01:00
|
|
|
|
2012-03-17 16:43:28 +01:00
|
|
|
# variables that should probably never be changed but someone will want to, I'll bet...
|
2012-03-16 05:29:45 +01:00
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
|
2012-05-21 09:53:20 +02:00
|
|
|
#<<<
|
|
|
|
$REMOTE_COMMAND_PATT = qr(^[-0-9a-zA-Z._\@/+ :,\%=]*$);
|
|
|
|
$REF_OR_FILENAME_PATT = qr(^[0-9a-zA-Z][-0-9a-zA-Z._\@/+ :,]*$);
|
|
|
|
$REPONAME_PATT = qr(^\@?[0-9a-zA-Z][-0-9a-zA-Z._\@/+]*$);
|
|
|
|
$REPOPATT_PATT = qr(^\@?[[0-9a-zA-Z][-0-9a-zA-Z._\@/+\\^$|()[\]*?{},]*$);
|
|
|
|
$USERNAME_PATT = qr(^\@?[0-9a-zA-Z][-0-9a-zA-Z._\@+]*$);
|
|
|
|
|
2012-03-16 09:59:45 +01:00
|
|
|
$UNSAFE_PATT = qr([`~#\$\&()|;<>]);
|
2012-05-21 09:53:20 +02:00
|
|
|
#>>>
|
2012-03-16 05:29:45 +01:00
|
|
|
|
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
|
2012-03-17 16:43:28 +01:00
|
|
|
# find the rc file and 'do' it
|
|
|
|
# ----------------------------------------------------------------------
|
2012-03-16 05:29:45 +01:00
|
|
|
my $current_data_version = "3.0";
|
|
|
|
|
|
|
|
my $rc = glrc('filename');
|
2012-06-21 03:19:18 +02:00
|
|
|
if (-r $rc) {
|
|
|
|
do $rc or die $@;
|
|
|
|
}
|
2012-03-23 02:07:44 +01:00
|
|
|
if ( defined($GL_ADMINDIR) ) {
|
2012-03-22 01:47:34 +01:00
|
|
|
say2 "";
|
2012-05-21 11:52:19 +02:00
|
|
|
say2 "FATAL: '$rc' seems to be for older gitolite; please see doc/g2migr.mkd\n" . "(online at http://sitaramc.github.com/gitolite/g2migr.html)";
|
2012-03-22 01:47:34 +01:00
|
|
|
|
|
|
|
exit 1;
|
|
|
|
}
|
2012-03-27 12:48:25 +02:00
|
|
|
|
2012-03-16 05:29:45 +01:00
|
|
|
# let values specified in rc file override our internal ones
|
2012-03-27 12:48:25 +02:00
|
|
|
# ----------------------------------------------------------------------
|
2012-03-16 05:29:45 +01:00
|
|
|
@rc{ keys %RC } = values %RC;
|
|
|
|
|
2012-03-27 12:48:25 +02:00
|
|
|
# add internal triggers
|
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
|
2012-03-25 17:59:14 +02:00
|
|
|
# is the server/repo in a writable state (i.e., not down for maintenance etc)
|
2012-04-16 14:08:57 +02:00
|
|
|
unshift @{ $rc{ACCESS_1} }, 'Writable::access_1';
|
2012-03-25 17:59:14 +02:00
|
|
|
|
2012-03-27 12:48:25 +02:00
|
|
|
# (testing only) override the rc file silently
|
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
# use an env var that is highly unlikely to appear in real life :)
|
2012-03-15 15:34:30 +01:00
|
|
|
do $ENV{G3T_RC} if exists $ENV{G3T_RC} and -r $ENV{G3T_RC};
|
2012-03-15 10:35:51 +01:00
|
|
|
|
2012-06-09 04:18:56 +02:00
|
|
|
# setup some perl/rc/env vars
|
2012-03-17 16:43:28 +01:00
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
|
2012-06-13 11:13:19 +02:00
|
|
|
unshift @INC, "$rc{LOCAL_CODE}/lib" if $rc{LOCAL_CODE};
|
2012-06-09 04:18:56 +02:00
|
|
|
|
2012-07-10 17:34:52 +02:00
|
|
|
$ENV{PATH} = "$ENV{GL_BINDIR}:$ENV{PATH}" unless $ENV{PATH} =~ /^$ENV{GL_BINDIR}:/;
|
2012-03-12 04:08:50 +01:00
|
|
|
|
2012-03-17 16:43:28 +01:00
|
|
|
{
|
2012-03-21 11:53:50 +01:00
|
|
|
$rc{GL_TID} = $ENV{GL_TID} ||= $$;
|
|
|
|
# TID: loosely, transaction ID. The first PID at the entry point passes
|
|
|
|
# it down to all its children so you can track each access, across all the
|
|
|
|
# various commands it spawns and actions it generates.
|
|
|
|
|
|
|
|
$rc{GL_LOGFILE} = $ENV{GL_LOGFILE} ||= gen_lfn( $rc{LOG_TEMPLATE} );
|
2012-03-17 16:43:28 +01:00
|
|
|
}
|
|
|
|
|
2012-03-20 18:30:29 +01:00
|
|
|
# these two are meant to help externally written commands (see
|
2012-03-27 15:58:56 +02:00
|
|
|
# src/commands/writable for an example)
|
2012-03-20 18:30:29 +01:00
|
|
|
$ENV{GL_REPO_BASE} = $rc{GL_REPO_BASE};
|
|
|
|
$ENV{GL_ADMIN_BASE} = $rc{GL_ADMIN_BASE};
|
|
|
|
|
2012-03-16 05:29:45 +01:00
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
|
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
|
|
|
|
my $glrc_default_text = '';
|
|
|
|
{
|
|
|
|
local $/ = undef;
|
|
|
|
$glrc_default_text = <DATA>;
|
|
|
|
}
|
|
|
|
|
|
|
|
sub glrc {
|
|
|
|
my $cmd = shift;
|
|
|
|
if ( $cmd eq 'default-filename' ) {
|
|
|
|
return "$ENV{HOME}/.gitolite.rc";
|
|
|
|
} elsif ( $cmd eq 'default-text' ) {
|
|
|
|
return $glrc_default_text if $glrc_default_text;
|
|
|
|
_die "rc file default text not set; this should not happen!";
|
|
|
|
} elsif ( $cmd eq 'filename' ) {
|
|
|
|
# where is the rc file?
|
|
|
|
|
|
|
|
# search $HOME first
|
|
|
|
return "$ENV{HOME}/.gitolite.rc" if -f "$ENV{HOME}/.gitolite.rc";
|
|
|
|
|
|
|
|
return '';
|
|
|
|
} elsif ( $cmd eq 'current-data-version' ) {
|
|
|
|
return $current_data_version;
|
|
|
|
} else {
|
2012-05-21 11:52:19 +02:00
|
|
|
_die "unknown argument to glrc: '$cmd'";
|
2012-03-16 05:29:45 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-03-19 03:01:09 +01:00
|
|
|
# exported functions
|
2012-03-16 05:29:45 +01:00
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
|
2012-03-23 02:07:44 +01:00
|
|
|
my $all = 0;
|
|
|
|
my $nonl = 0;
|
|
|
|
my $quiet = 0;
|
2012-03-16 05:29:45 +01:00
|
|
|
|
|
|
|
sub query_rc {
|
|
|
|
|
|
|
|
my @vars = args();
|
|
|
|
|
|
|
|
no strict 'refs';
|
|
|
|
|
2012-03-12 16:24:30 +01:00
|
|
|
if ($all) {
|
|
|
|
for my $e ( sort keys %rc ) {
|
|
|
|
print "$e=" . ( defined( $rc{$e} ) ? $rc{$e} : 'undef' ) . "\n";
|
2012-03-16 05:29:45 +01:00
|
|
|
}
|
2012-03-12 16:24:30 +01:00
|
|
|
exit 0;
|
2012-03-16 05:29:45 +01:00
|
|
|
}
|
|
|
|
|
2012-06-02 13:22:11 +02:00
|
|
|
my $cv = \%rc; # current "value"
|
|
|
|
while (@vars) {
|
|
|
|
my $v = shift @vars;
|
|
|
|
|
|
|
|
# dig into the rc hash, using each var as a component
|
|
|
|
if (not ref($cv)) {
|
|
|
|
_warn "unused arguments...";
|
|
|
|
last;
|
|
|
|
} elsif (ref($cv) eq 'HASH') {
|
|
|
|
$cv = $cv->{$v} || '';
|
|
|
|
} elsif (ref($cv) eq 'ARRAY') {
|
|
|
|
$cv = $cv->[$v] || '';
|
|
|
|
} else {
|
|
|
|
_die "dont know what to do with " . ref($cv) . " item in the rc file";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# we've run out of arguments so $cv is what we have. If we're supposed to
|
|
|
|
# be quiet, we don't have to print anything so let's get that done first:
|
|
|
|
exit ( $cv ? 0 : 1 ) if $quiet; # shell truth
|
|
|
|
|
|
|
|
# print values (notice we ignore the '-n' option if it's a ref)
|
|
|
|
if (ref($cv) eq 'HASH') {
|
|
|
|
print join("\n", sort keys %$cv), "\n" if %$cv;
|
|
|
|
} elsif (ref($cv) eq 'ARRAY') {
|
|
|
|
print join("\n", @$cv), "\n" if @$cv;
|
|
|
|
} else {
|
|
|
|
print $cv . ( $nonl ? '' : "\n" ) if $cv;
|
|
|
|
}
|
|
|
|
exit ( $cv ? 0 : 1 ); # shell truth
|
2012-03-16 05:29:45 +01:00
|
|
|
}
|
|
|
|
|
2012-03-15 14:44:40 +01:00
|
|
|
sub version {
|
|
|
|
my $version = '';
|
|
|
|
$version = '(unknown)';
|
2012-03-31 16:15:59 +02:00
|
|
|
for ("$ENV{GL_BINDIR}/VERSION") {
|
2012-03-15 14:44:40 +01:00
|
|
|
$version = slurp($_) if -r $_;
|
|
|
|
}
|
|
|
|
chomp($version);
|
|
|
|
return $version;
|
|
|
|
}
|
|
|
|
|
2012-03-19 03:01:09 +01:00
|
|
|
sub trigger {
|
|
|
|
my $rc_section = shift;
|
|
|
|
|
|
|
|
if ( exists $rc{$rc_section} ) {
|
|
|
|
if ( ref( $rc{$rc_section} ) ne 'ARRAY' ) {
|
2012-05-21 11:52:19 +02:00
|
|
|
_die "'$rc_section' section in rc file is not a perl list";
|
2012-03-19 03:01:09 +01:00
|
|
|
} else {
|
|
|
|
for my $s ( @{ $rc{$rc_section} } ) {
|
2012-03-30 02:41:06 +02:00
|
|
|
my ( $pgm, @args ) = split ' ', $s;
|
2012-03-19 03:01:09 +01:00
|
|
|
|
2012-03-30 02:41:06 +02:00
|
|
|
if ( my ( $module, $sub ) = ( $pgm =~ /^(.*)::(\w+)$/ ) ) {
|
2012-03-25 17:59:14 +02:00
|
|
|
|
|
|
|
require Gitolite::Triggers;
|
2012-04-18 02:56:18 +02:00
|
|
|
trace( 1, 'trigger', $module, $sub, @args, $rc_section, @_ );
|
2012-03-30 02:41:06 +02:00
|
|
|
Gitolite::Triggers::run( $module, $sub, @args, $rc_section, @_ );
|
2012-03-25 17:59:14 +02:00
|
|
|
|
|
|
|
} else {
|
2012-06-09 04:18:56 +02:00
|
|
|
$pgm = _which("triggers/$pgm", 'x');
|
2012-03-25 17:59:14 +02:00
|
|
|
|
2012-06-09 04:18:56 +02:00
|
|
|
_warn("skipped command '$s'"), next if not $pgm;
|
2012-03-25 17:59:14 +02:00
|
|
|
trace( 2, "command: $s" );
|
|
|
|
_system( $pgm, @args, $rc_section, @_ ); # they better all return with 0 exit codes!
|
|
|
|
}
|
2012-03-19 03:01:09 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
trace( 2, "'$rc_section' not found in rc" );
|
|
|
|
}
|
|
|
|
|
2012-06-09 04:18:56 +02:00
|
|
|
sub _which {
|
2012-06-13 11:13:19 +02:00
|
|
|
# looks for a file in LOCAL_CODE or GL_BINDIR. Returns whichever exists
|
|
|
|
# (LOCAL_CODE preferred if defined) or 0 if not found.
|
2012-06-09 04:18:56 +02:00
|
|
|
my $file = shift;
|
|
|
|
my $mode = shift; # could be 'x' or 'r'
|
|
|
|
|
|
|
|
my @files = ("$rc{GL_BINDIR}/$file");
|
2012-06-13 11:13:19 +02:00
|
|
|
unshift @files, ("$rc{LOCAL_CODE}/$file") if $rc{LOCAL_CODE};
|
2012-06-09 04:18:56 +02:00
|
|
|
|
|
|
|
for my $f ( @files ) {
|
|
|
|
return $f if -x $f;
|
|
|
|
return $f if -r $f and $mode eq 'r';
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-03-16 05:29:45 +01:00
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
|
2012-03-12 16:24:30 +01:00
|
|
|
=for args
|
|
|
|
Usage: gitolite query-rc -a
|
2012-06-02 13:22:11 +02:00
|
|
|
gitolite query-rc [-n] [-q] rc-variable
|
2012-03-12 16:24:30 +01:00
|
|
|
|
2012-06-02 13:22:11 +02:00
|
|
|
-a print all variables and values (first level only)
|
|
|
|
-n do not append a newline if variable is scalar
|
2012-03-23 02:07:44 +01:00
|
|
|
-q exit code only (shell truth; 0 is success)
|
2012-03-12 16:24:30 +01:00
|
|
|
|
2012-06-02 13:22:11 +02:00
|
|
|
Query the rc hash. Second and subsequent arguments dig deeper into the hash.
|
|
|
|
The examples are for the default configuration; yours may be different.
|
2012-03-12 16:24:30 +01:00
|
|
|
|
2012-06-02 13:22:11 +02:00
|
|
|
Single values:
|
|
|
|
gitolite query-rc GL_ADMIN_BASE # prints "/home/git/.gitolite" or similar
|
|
|
|
gitolite query-rc UMASK # prints "63" (that's 0077 in decimal!)
|
2012-03-12 16:24:30 +01:00
|
|
|
|
2012-06-02 13:22:11 +02:00
|
|
|
Hashes:
|
|
|
|
gitolite query-rc COMMANDS
|
|
|
|
# prints "desc", "help", "info", "perms", "writable", one per line
|
|
|
|
gitolite query-rc COMMANDS help # prints 1
|
|
|
|
gitolite query-rc -q COMMANDS help # prints nothing; exit code is 0
|
|
|
|
gitolite query-rc COMMANDS fork # prints nothing; exit code is 1
|
2012-03-23 02:07:44 +01:00
|
|
|
|
2012-06-02 13:22:11 +02:00
|
|
|
Arrays (somewhat less useful):
|
|
|
|
gitolite query-rc POST_GIT # prints nothing; exit code is 0
|
|
|
|
gitolite query-rc POST_COMPILE # prints 4 lines
|
|
|
|
gitolite query-rc POST_COMPILE 0 # prints the first of those 4 lines
|
|
|
|
|
|
|
|
Explore:
|
|
|
|
gitolite query-rc -a
|
|
|
|
# prints all first level variables and values, one per line. Any that are
|
|
|
|
# listed as HASH or ARRAY can be explored further in subsequent commands.
|
2012-03-12 16:24:30 +01:00
|
|
|
=cut
|
|
|
|
|
2012-03-16 05:29:45 +01:00
|
|
|
sub args {
|
|
|
|
my $help = 0;
|
|
|
|
|
|
|
|
GetOptions(
|
2012-03-23 02:07:44 +01:00
|
|
|
'all|a' => \$all,
|
|
|
|
'nonl|n' => \$nonl,
|
|
|
|
'quiet|q' => \$quiet,
|
|
|
|
'help|h' => \$help,
|
2012-03-16 05:29:45 +01:00
|
|
|
) or usage();
|
|
|
|
|
2012-03-23 02:07:44 +01:00
|
|
|
usage("'-a' cannot be combined with other arguments or options") if $all and ( @ARGV or $nonl or $quiet );
|
2012-03-16 05:29:45 +01:00
|
|
|
usage() if not $all and not @ARGV or $help;
|
|
|
|
return @ARGV;
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|
|
|
|
|
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
|
|
|
|
__DATA__
|
|
|
|
# configuration variables for gitolite
|
|
|
|
|
2012-03-12 16:24:30 +01:00
|
|
|
# This file is in perl syntax. But you do NOT need to know perl to edit it --
|
2012-03-17 07:55:38 +01:00
|
|
|
# just mind the commas, use single quotes unless you know what you're doing,
|
|
|
|
# and make sure the brackets and braces stay matched up!
|
2012-03-11 17:03:15 +01:00
|
|
|
|
2012-03-12 16:24:30 +01:00
|
|
|
# (Tip: perl allows a comma after the last item in a list also!)
|
2012-03-16 05:29:45 +01:00
|
|
|
|
2012-05-30 10:44:29 +02:00
|
|
|
# HELP for commands (see COMMANDS list below) can be had by running the
|
|
|
|
# command with "-h" as the sole argument.
|
|
|
|
|
|
|
|
# HELP for all the other external programs (the syntactic sugar helpers and
|
|
|
|
# the various programs/functions in the 8 trigger lists), can be found in
|
|
|
|
# doc/non-core.mkd (http://sitaramc.github.com/gitolite/non-core.html) or in
|
|
|
|
# the corresponding source file itself.
|
|
|
|
|
2012-03-16 05:29:45 +01:00
|
|
|
%RC = (
|
2012-03-31 18:12:16 +02:00
|
|
|
# if you're using mirroring, you need a hostname. This is *one* simple
|
|
|
|
# word, not a full domain name. See documentation if in doubt
|
|
|
|
# HOSTNAME => 'darkstar',
|
2012-03-16 05:29:45 +01:00
|
|
|
UMASK => 0077,
|
2012-07-01 12:30:25 +02:00
|
|
|
|
|
|
|
# look in the "GIT-CONFIG" section in the README for what to do
|
2012-03-17 07:55:38 +01:00
|
|
|
GIT_CONFIG_KEYS => '',
|
|
|
|
|
2012-03-30 02:41:06 +02:00
|
|
|
# comment out if you don't need all the extra detail in the logfile
|
|
|
|
LOG_EXTRA => 1,
|
|
|
|
|
2012-03-22 10:15:30 +01:00
|
|
|
# settings used by external programs; uncomment and change as needed. You
|
|
|
|
# can add your own variables for use in your own external programs; take a
|
2012-04-06 02:57:34 +02:00
|
|
|
# look at the info and desc commands for perl and shell samples.
|
2012-03-22 10:15:30 +01:00
|
|
|
|
2012-04-06 02:57:34 +02:00
|
|
|
# used by the CpuTime trigger
|
2012-03-22 10:15:30 +01:00
|
|
|
# DISPLAY_CPU_TIME => 1,
|
|
|
|
# CPU_TIME_WARN_LIMIT => 0.1,
|
|
|
|
# used by the desc command
|
|
|
|
# WRITER_CAN_UPDATE_DESC => 1,
|
|
|
|
# used by the info command
|
|
|
|
# SITE_INFO => 'Please see http://blahblah/gitolite for more help',
|
|
|
|
|
2012-03-25 05:45:39 +02:00
|
|
|
# add more roles (like MANAGER, TESTER, ...) here.
|
|
|
|
# WARNING: if you make changes to this hash, you MUST run 'gitolite
|
|
|
|
# compile' afterward, and possibly also 'gitolite trigger POST_COMPILE'
|
2012-03-17 07:55:38 +01:00
|
|
|
ROLES =>
|
|
|
|
{
|
|
|
|
READERS => 1,
|
|
|
|
WRITERS => 1,
|
|
|
|
},
|
|
|
|
# uncomment (and change) this if you wish
|
|
|
|
# DEFAULT_ROLE_PERMS => 'READERS @all',
|
2012-03-10 15:13:42 +01:00
|
|
|
|
2012-03-25 07:13:36 +02:00
|
|
|
# comment out or uncomment as needed
|
|
|
|
# these are available to remote users
|
|
|
|
COMMANDS =>
|
|
|
|
{
|
|
|
|
'help' => 1,
|
|
|
|
'desc' => 1,
|
2012-04-22 06:04:06 +02:00
|
|
|
# 'fork' => 1,
|
2012-04-11 01:21:02 +02:00
|
|
|
'info' => 1,
|
2012-03-31 18:12:16 +02:00
|
|
|
# 'mirror' => 1,
|
2012-04-11 01:21:02 +02:00
|
|
|
'perms' => 1,
|
|
|
|
# 'sskm' => 1,
|
2012-03-27 15:58:56 +02:00
|
|
|
'writable' => 1,
|
2012-04-11 01:21:02 +02:00
|
|
|
# 'D' => 1,
|
2012-03-25 07:13:36 +02:00
|
|
|
},
|
|
|
|
|
2012-03-11 17:03:15 +01:00
|
|
|
# comment out or uncomment as needed
|
2012-03-12 16:24:30 +01:00
|
|
|
# these will run in sequence during the conf file parse
|
2012-03-10 15:13:42 +01:00
|
|
|
SYNTACTIC_SUGAR =>
|
|
|
|
[
|
|
|
|
# 'continuation-lines',
|
2012-05-30 10:44:29 +02:00
|
|
|
# 'keysubdirs-as-groups',
|
2012-03-11 17:03:15 +01:00
|
|
|
],
|
|
|
|
|
2012-03-31 18:12:16 +02:00
|
|
|
# comment out or uncomment as needed
|
|
|
|
# these will run in sequence to modify the input (arguments and environment)
|
|
|
|
INPUT =>
|
|
|
|
[
|
2012-04-07 15:36:02 +02:00
|
|
|
# 'CpuTime::input',
|
2012-05-30 10:44:29 +02:00
|
|
|
# 'Shell::input',
|
|
|
|
# 'Alias::input',
|
2012-03-31 18:12:16 +02:00
|
|
|
# 'Mirroring::input',
|
|
|
|
],
|
|
|
|
|
2012-03-27 12:48:25 +02:00
|
|
|
# comment out or uncomment as needed
|
|
|
|
# these will run in sequence just after the first access check is done
|
|
|
|
ACCESS_1 =>
|
|
|
|
[
|
|
|
|
],
|
|
|
|
|
2012-03-25 07:13:36 +02:00
|
|
|
# comment out or uncomment as needed
|
2012-04-04 01:28:50 +02:00
|
|
|
# these will run in sequence just before the actual git command is invoked
|
2012-03-25 07:13:36 +02:00
|
|
|
PRE_GIT =>
|
|
|
|
[
|
|
|
|
# 'renice 10',
|
2012-03-31 18:12:16 +02:00
|
|
|
# 'Mirroring::pre_git',
|
2012-03-26 17:57:49 +02:00
|
|
|
# 'partial-copy',
|
2012-03-25 07:13:36 +02:00
|
|
|
],
|
|
|
|
|
2012-03-27 12:48:25 +02:00
|
|
|
# comment out or uncomment as needed
|
|
|
|
# these will run in sequence just after the second access check is done
|
|
|
|
ACCESS_2 =>
|
|
|
|
[
|
|
|
|
],
|
|
|
|
|
2012-03-25 07:13:36 +02:00
|
|
|
# comment out or uncomment as needed
|
2012-04-04 01:28:50 +02:00
|
|
|
# these will run in sequence after the git command returns
|
2012-03-25 07:13:36 +02:00
|
|
|
POST_GIT =>
|
|
|
|
[
|
2012-03-31 18:12:16 +02:00
|
|
|
# 'Mirroring::post_git',
|
2012-04-06 02:57:34 +02:00
|
|
|
# 'CpuTime::post_git',
|
2012-03-25 07:13:36 +02:00
|
|
|
],
|
|
|
|
|
2012-04-04 01:28:50 +02:00
|
|
|
# comment out or uncomment as needed
|
|
|
|
# these will run in sequence before a new wild repo is created
|
|
|
|
PRE_CREATE =>
|
|
|
|
[
|
|
|
|
],
|
|
|
|
|
2012-03-11 17:03:15 +01:00
|
|
|
# comment out or uncomment as needed
|
2012-03-27 12:48:25 +02:00
|
|
|
# these will run in sequence after a new wild repo is created
|
|
|
|
POST_CREATE =>
|
2012-03-11 17:03:15 +01:00
|
|
|
[
|
2012-03-19 11:45:21 +01:00
|
|
|
'post-compile/update-git-configs',
|
2012-03-19 09:34:17 +01:00
|
|
|
'post-compile/update-gitweb-access-list',
|
|
|
|
'post-compile/update-git-daemon-access-list',
|
|
|
|
],
|
|
|
|
|
|
|
|
# comment out or uncomment as needed
|
2012-03-27 12:48:25 +02:00
|
|
|
# these will run in sequence after post-update
|
|
|
|
POST_COMPILE =>
|
2012-03-19 09:34:17 +01:00
|
|
|
[
|
2012-03-27 12:48:25 +02:00
|
|
|
'post-compile/ssh-authkeys',
|
2012-03-21 08:53:32 +01:00
|
|
|
'post-compile/update-git-configs',
|
|
|
|
'post-compile/update-gitweb-access-list',
|
|
|
|
'post-compile/update-git-daemon-access-list',
|
2012-03-11 17:03:15 +01:00
|
|
|
],
|
2012-03-16 05:29:45 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# per perl rules, this should be the last line in such a file:
|
|
|
|
1;
|
|
|
|
|
|
|
|
# Local variables:
|
|
|
|
# mode: perl
|
|
|
|
# End:
|
|
|
|
# vim: set syn=perl:
|