gitweb: fallback to system-wide config file if default config does not exist
From a distribution point of view, configuration files for applications should reside in /etc/. On the other hand it's convenient for multiple instances of gitweb (e.g. virtual web servers on a single machine) to have a per-instance configuration file, just as gitweb currently supports through the file gitweb_config.perl next to the cgi. To support both at runtime, this commit introduces GITWEB_CONFIG_SYSTEM as a system-wide configuration file which will be used as a fallback if the config file sprecified throug GITWEB_CONFIG does not exist. See also http://bugs.debian.org/450592 Signed-off-by: Gerrit Pape <pape@smarden.org> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
1768905b51
commit
17a8b25005
@ -369,7 +369,12 @@ sub filter_snapshot_fmts {
|
||||
}
|
||||
|
||||
our $GITWEB_CONFIG = $ENV{'GITWEB_CONFIG'} || "++GITWEB_CONFIG++";
|
||||
do $GITWEB_CONFIG if -e $GITWEB_CONFIG;
|
||||
if (-e $GITWEB_CONFIG) {
|
||||
do $GITWEB_CONFIG;
|
||||
} else {
|
||||
our $GITWEB_CONFIG_SYSTEM = $ENV{'GITWEB_CONFIG_SYSTEM'} || "++GITWEB_CONFIG_SYSTEM++";
|
||||
do $GITWEB_CONFIG_SYSTEM if -e $GITWEB_CONFIG_SYSTEM;
|
||||
}
|
||||
|
||||
# version of the core git binary
|
||||
our $git_version = qx($GIT --version) =~ m/git version (.*)$/ ? $1 : "unknown";
|
||||
|
||||
Reference in New Issue
Block a user