From: Kenneth Lorber Date: Thu, 12 May 2016 19:17:58 +0000 (-0400) Subject: Bug 1269160 - Localconfig.pm: LOCALCONFIG_VARS docs and functionality loss X-Git-Tag: release-5.1.1~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7c1d3b1b83b996df937764aa4ef1cc1dd56f5a46;p=thirdparty%2Fbugzilla.git Bug 1269160 - Localconfig.pm: LOCALCONFIG_VARS docs and functionality loss r=dylan --- diff --git a/Bugzilla/Install/Localconfig.pm b/Bugzilla/Install/Localconfig.pm index d5de236e03..82ec9ae35e 100644 --- a/Bugzilla/Install/Localconfig.pm +++ b/Bugzilla/Install/Localconfig.pm @@ -297,11 +297,15 @@ sub update_localconfig { open(my $fh, ">:utf8", $filename) or die "$filename: $!"; foreach my $var (LOCALCONFIG_VARS) { my $name = $var->{name}; - my $desc = install_string("localconfig_$name", { root => ROOT_USER }); - chomp($desc); - # Make the description into a comment. - $desc =~ s/^/# /mg; - print $fh $desc, "\n", + my $desc = $var->{desc}; + if(!length $desc){ + $desc = install_string("localconfig_$name", { root => ROOT_USER }); + chomp($desc); + # Make the description into a comment. + $desc =~ s/^/# /mg; + $desc .= "\n"; + } + print $fh $desc, Data::Dumper->Dump([$localconfig->{$name}], ["*$name"]), "\n"; } @@ -347,15 +351,16 @@ to access localconfig variables. =item C -An array of hashrefs. These hashrefs contain three keys: +An array of hashrefs. These hashrefs contain two or three keys: name - The name of the variable. default - The default value for the variable. Should always be something that can fit in a scalar. - desc - Additional text to put in localconfig before the variable + desc - If present, additional text to put in localconfig before the variable definition. Must end in a newline. Each line should start with "#" unless you have some REALLY good reason not - to do that. + to do that. If not present, the description is taken from + F