]> Lady’s Gitweb - Gitweb/blobdiff - gitweb.perl
gitweb: optionally read config from GITWEB_CONFIG
[Gitweb] / gitweb.perl
index 8a979d5959d94f8e67a00dbf1558d126d273b11e441487de0e3f96d7d9a6e4eb..92b96af09dd6ac7a350606be795f7f640655fc587f2dc04c8464efad4ff161fd 100755 (executable)
@@ -31,14 +31,8 @@ our $GIT = "@@GIT_BINDIR@@/git";
 #our $projectroot = "/pub/scm";
 our $projectroot = "@@GITWEB_PROJECTROOT@@";
 
 #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";
 # 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;
 
 # 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 $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';
 
 # 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;
 
 # (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) {
 # input validation and dispatch
 our $action = $cgi->param('a');
 if (defined $action) {
This page took 0.214264 seconds and 4 git commands to generate.