diff options
author | Jeff King <peff@peff.net> | 2006-08-02 15:23:34 -0400 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-08-02 13:56:34 -0700 |
commit | c8d138a8c004ebce6ef840cfcc7c47227c2d16ba (patch) | |
tree | fcd38550dee75598d7da521c329da4dc0f49d2c7 /gitweb | |
parent | 22987ae0bc354bb2277c068ce15e9887f7cf0626 (diff) | |
download | git-c8d138a8c004ebce6ef840cfcc7c47227c2d16ba.tar.gz git-c8d138a8c004ebce6ef840cfcc7c47227c2d16ba.tar.xz |
gitweb: optionally read config from GITWEB_CONFIG
Configuration will first be taken from variables inside the gitweb.cgi
script, which in turn come from the Makefile. Afterwards, the contents of
GITWEB_CONFIG are read, overriding the builtin defaults.
This should eliminate the need for editing the gitweb script at all. Users
should edit the Makefile and/or add a config file.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'gitweb')
-rwxr-xr-x | gitweb/gitweb.perl | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 1db1414a0..d5b2de8b3 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -31,14 +31,8 @@ our $GIT = "@@GIT_BINDIR@@/git"; #our $projectroot = "/pub/scm"; our $projectroot = "@@GITWEB_PROJECTROOT@@"; -# version of the core git binary -our $git_version = qx($GIT --version) =~ m/git version (.*)$/ ? $1 : "unknown"; - # location for temporary files needed for diffs our $git_temp = "/tmp/gitweb"; -if (! -d $git_temp) { - mkdir($git_temp, 0700) || die_error("Couldn't mkdir $git_temp"); -} # target of the home link on top of all pages our $home_link = $my_uri; @@ -56,7 +50,7 @@ our $stylesheet = "@@GITWEB_CSS@@"; our $logo = "@@GITWEB_LOGO@@"; # source of projects list -our $projects_list = "@@GITWEB_LIST@@" || "$projectroot"; +our $projects_list = "@@GITWEB_LIST@@"; # default blob_plain mimetype and default charset for text/plain blob our $default_blob_plain_mimetype = 'text/plain'; @@ -66,6 +60,17 @@ our $default_text_plain_charset = undef; # (relative to the current git repository) our $mimetypes_file = undef; +our $GITWEB_CONFIG = "@@GITWEB_CONFIG@@"; +require $GITWEB_CONFIG if -e $GITWEB_CONFIG; + +# version of the core git binary +our $git_version = qx($GIT --version) =~ m/git version (.*)$/ ? $1 : "unknown"; + +$projects_list ||= $projectroot; +if (! -d $git_temp) { + mkdir($git_temp, 0700) || die_error("Couldn't mkdir $git_temp"); +} + # input validation and dispatch our $action = $cgi->param('a'); if (defined $action) { |