diff options
author | Frank Lichtenheld <frank@lichtenheld.de> | 2007-03-19 16:55:59 +0100 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-03-22 01:26:26 -0700 |
commit | d55820ced668477e07be7d9488c7965906a61b54 (patch) | |
tree | ce39d9725a6aae91d7c97501f8e54c5d6c9c28ad /git-cvsserver.perl | |
parent | 92a39a14d00fdfe6868bacf86cbf933a2cc6be93 (diff) | |
download | git-d55820ced668477e07be7d9488c7965906a61b54.tar.gz git-d55820ced668477e07be7d9488c7965906a61b54.tar.xz |
cvsserver: Allow to override the configuration per access method
Allow to override the gitcvs.enabled and gitcvs.logfile configuration
variables for each access method (i.e. "ext" or "pserver") in the
form gitcvs.<method>.<var>
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-cvsserver.perl')
-rwxr-xr-x | git-cvsserver.perl | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/git-cvsserver.perl b/git-cvsserver.perl index 4edb79601..5d2b6f357 100755 --- a/git-cvsserver.perl +++ b/git-cvsserver.perl @@ -191,7 +191,10 @@ sub req_Root } } - unless ( defined ( $cfg->{gitcvs}{enabled} ) and $cfg->{gitcvs}{enabled} =~ /^\s*(1|true|yes)\s*$/i ) + unless ( ($cfg->{gitcvs}{$state->{method}}{enabled} + and $cfg->{gitcvs}{$state->{method}}{enabled} =~ /^\s*(1|true|yes)\s*$/i) + or ($cfg->{gitcvs}{enabled} + and $cfg->{gitcvs}{enabled} =~ /^\s*(1|true|yes)\s*$/i) ) { print "E GITCVS emulation needs to be enabled on this repo\n"; print "E the repo config file needs a [gitcvs] section added, and the parameter 'enabled' set to 1\n"; @@ -200,9 +203,10 @@ sub req_Root return 0; } - if ( defined ( $cfg->{gitcvs}{logfile} ) ) + my $logfile = $cfg->{gitcvs}{$state->{method}}{logfile} || $cfg->{gitcvs}{logfile}; + if ( $logfile ) { - $log->setfile($cfg->{gitcvs}{logfile}); + $log->setfile($logfile); } else { $log->nofile(); } |