summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 22987ae)
raw | patch | inline | side by side (parent: 22987ae)
author | Jeff King <peff@peff.net> | |
Wed, 2 Aug 2006 19:23:34 +0000 (15:23 -0400) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 2 Aug 2006 20:56:34 +0000 (13:56 -0700) |
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>
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>
Makefile | patch | blob | history | |
gitweb/gitweb.perl | patch | blob | history |
diff --git a/Makefile b/Makefile
index 6624c7501e754b0a2e27894e93140122ce8bd196..a2b4acaaaecb223f9e08c0a3446957b89ba28d77 100644 (file)
--- a/Makefile
+++ b/Makefile
# DESTDIR=
# default configuration for gitweb
+GITWEB_CONFIG = gitweb_config.perl
GITWEB_SITENAME =
GITWEB_PROJECTROOT = /pub/git
GITWEB_LIST =
sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \
-e 's|@@GIT_VERSION@@|$(GIT_VERSION)|g' \
-e 's|@@GIT_BINDIR@@|$(bindir)|g' \
+ -e 's|@@GITWEB_CONFIG@@|$(GITWEB_CONFIG)|g' \
-e 's|@@GITWEB_SITENAME@@|$(GITWEB_SITENAME)|g' \
-e 's|@@GITWEB_PROJECTROOT@@|$(GITWEB_PROJECTROOT)|g' \
-e 's|@@GITWEB_LIST@@|$(GITWEB_LIST)|g' \
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 1db1414a0a295b0b71ae048e7b4fff03618f7630..d5b2de8b3afb9bfb8d3551cc3ef0c727300b93b9 100755 (executable)
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
#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;
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';
# (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) {