From 7c1d3b1b83b996df937764aa4ef1cc1dd56f5a46 Mon Sep 17 00:00:00 2001 From: Kenneth Lorber Date: Thu, 12 May 2016 15:17:58 -0400 Subject: Bug 1269160 - Localconfig.pm: LOCALCONFIG_VARS docs and functionality loss r=dylan --- Bugzilla/Install/Localconfig.pm | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Bugzilla/Install/Localconfig.pm b/Bugzilla/Install/Localconfig.pm index d5de236e0..82ec9ae35 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