Re: [PATCH v3] Gitweb: Use a default for a bad env config file variable
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Aug 11, 2010, 00:08 UTC
- Message-ID
- <20100811000846.GF2099@burratino>
- In-Reply-To
- <1281458849.28858.18.camel@ping.CS.McGill.CA>
Hi James,
James Shubin wrote:
> Signed-off-by: James Shubin <purpleidea@gmail.com>
[...]
Show 5 quoted lines
> 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 value).
[...]
| our $GITWEB_CONFIG = $ENV{'GITWEB_CONFIG'} || "++GITWEB_CONFIG++";
| our $GITWEB_CONFIG_SYSTEM = $ENV{'GITWEB_CONFIG_SYSTEM'} || "++GITWEB_CONFIG_SYSTEM++"; # die if there are errors parsing config file
| if (-e $GITWEB_CONFIG) {
| do $GITWEB_CONFIG;
| die $@ if $@;
| } elsif (-e $GITWEB_CONFIG_SYSTEM) {
| do $GITWEB_CONFIG_SYSTEM;
| die $@ if $@;
| } elsif (-e "++GITWEB_CONFIG_SYSTEM++") {
| ...Interesting. I am a bit nervous that this might be confusing. cc-ing Jakub for input.