On Wed, Aug 02, 2006 at 11:23:22AM -0500, Jon Loeliger wrote: > With this "params in config.mk" approach, I have to > run it multiple times, once for each web server I run. > > I _really_ would prefer an "include from ." feature > where I can place the specific gitweb_config.pm parts > in the same directory where gitweb.{pl,cgi} is installed. Why don't we have sensible compile-time defaults that can be overridden by a run-time config file like every other sane program? For those who are opposed to the run-time config, they can simply not have a config file. See the (completely untested) patch below. Obviously the config file name has to be set at build time. However, since it is interpolated by perl, you can do clever things like: /etc/gitweb/$ENV{MY_VIRTUAL_HOST}.pl -Peff --- Makefile | 2 ++ gitweb/gitweb.perl | 3 +++ 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/Makefile b/Makefile index 2562a2c..170d082 100644 --- a/Makefile +++ b/Makefile @@ -127,6 +127,7 @@ GIT_PYTHON_DIR = $(prefix)/share/git-cor # DESTDIR= # default configuration for gitweb +GITWEB_CONFIG = gitweb_config.perl GITWEB_SITENAME = GITWEB_PROJECTROOT = /pub/git GITWEB_LIST = @@ -629,6 +630,7 @@ gitweb/gitweb.cgi: gitweb/gitweb.perl 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 1db1414..cc33d97 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -66,6 +66,9 @@ # file to use for guessing MIME types be # (relative to the current git repository) our $mimetypes_file = undef; +our $GITWEB_CONFIG = "@@GITWEB_CONFIG@@"; +require $GITWEB_CONFIG if -e $GITWEB_CONFIG; + # input validation and dispatch our $action = $cgi->param('a'); if (defined $action) { -- 1.4.2.rc2.g59706-dirty - : send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html