git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch] Use a default for a bad env config file variable
@ 2010-08-10 15:11 James
  2010-08-10 15:41 ` Matthieu Moy
  0 siblings, 1 reply; 9+ messages in thread
From: James @ 2010-08-10 15:11 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 637 bytes --]

Hi git list, my name is James, and this is my first patch.

It's quite trivial really, all that changes is that if someone sets
the environment variable: $GITWEB_CONFIG_SYSTEM, and this points to
something like: /srv/gitosis/gitweb.conf, which doesn't actually
exist, then gitweb will default to trying out the built in default of
/etc/gitweb.conf (if it was built with that var).

This patch should make it easier for people who are configuring
gitweb+gitosis, so that a separate gitweb.conf config file can be used
to call the main config, but which doesn't null out the system
defaults if it is missing.

Thank you in advance,
_James

[-- Attachment #2: 0001-Use-a-default-for-a-bad-env-config-file-variable.patch --]
[-- Type: application/octet-stream, Size: 760 bytes --]

From d29adf8c788b8a747bfd38dd7e10f684de9aa8e9 Mon Sep 17 00:00:00 2001
From: James Shubin <purpleidea@gmail.com>
Date: Tue, 10 Aug 2010 10:30:22 -0400
Subject: [PATCH] Use a default for a bad env config file variable.

---
 gitweb/gitweb.perl |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 4efeebc..43294e1 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -605,6 +605,10 @@ sub evaluate_gitweb_config {
 	} elsif (-e $GITWEB_CONFIG_SYSTEM) {
 		do $GITWEB_CONFIG_SYSTEM;
 		die $@ if $@;
+	# if config file from env is missing, then try the default anyways
+	} elsif (-e "++GITWEB_CONFIG_SYSTEM++") {
+		do "++GITWEB_CONFIG_SYSTEM++";
+		die $@ if $@;
 	}
 }
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-08-11 13:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-10 15:11 [Patch] Use a default for a bad env config file variable James
2010-08-10 15:41 ` Matthieu Moy
2010-08-10 15:54   ` James
2010-08-10 16:02     ` Ævar Arnfjörð Bjarmason
2010-08-10 16:47       ` [PATCH v3] Gitweb: " James Shubin
2010-08-10 22:42         ` Jakub Narebski
2010-08-11 13:36           ` James Shubin
2010-08-11  0:08         ` Jonathan Nieder
2010-08-10 16:08     ` [Patch] " Michael J Gruber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).