Re: [PATCHv3 2/2 (version B)] gitweb: Use /etc/gitweb.conf even if gitweb_conf.perl exist

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jakub Narebski <jnareb@xxxxxxxxx> writes:

> This commit should be thought as exclusive to
>
>   [PATCH 2/2 (version A)] gitweb: Mention read_config_file in gitweb/README
>
> We have to choose one or the other.

Who says?  We do not have to.  Why not do this instead?

	our $GITWEB_CONFIG_COMMON = $ENV{'GITWEB_CONFIG_COMMON'} ||
		"/etc/gitweb-common.conf";

	# common system-wide settings for convenience
        read_config_file($GITWEB_COMMON);

        # as always, use the per-instance GITWEB_CONFIG if exists,
        # otherwise use GITWEB_SYSTEM_CONFIG
        read_config_file($GITWEB_CONFIG) ||
        	read_config_file($GITWEB_CONFIG_SYSTEM);

There is no risk of hurting any existing installations, and people who do
have things that needs to be shared do not have to go around and update
all the per-instance configuration files.

 diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index ce92d67..e4b0932 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -656,9 +656,10 @@ sub evaluate_gitweb_config {
>  	our $GITWEB_CONFIG = $ENV{'GITWEB_CONFIG'} || "++GITWEB_CONFIG++";
>  	our $GITWEB_CONFIG_SYSTEM = $ENV{'GITWEB_CONFIG_SYSTEM'} || "++GITWEB_CONFIG_SYSTEM++";
>  
> -	# use first config file that exists
> -	read_config_file($GITWEB_CONFIG) or
> +	# let settings in second override ones in first
>  	read_config_file($GITWEB_CONFIG_SYSTEM);
> +	read_config_file($GITWEB_CONFIG)
> +		if ($GITWEB_CONFIG ne $GITWEB_CONFIG_SYSTEM);
>  }
>  
>  # Get loadavg of system, to compare against $maxload.
--
To unsubscribe from this list: 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


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]