Commit 7c1d3b1b authored by Kenneth Lorber's avatar Kenneth Lorber Committed by Dylan Hardison

Bug 1269160 - Localconfig.pm: LOCALCONFIG_VARS docs and functionality loss

r=dylan
parent 67ad01e0
...@@ -297,11 +297,15 @@ sub update_localconfig { ...@@ -297,11 +297,15 @@ sub update_localconfig {
open(my $fh, ">:utf8", $filename) or die "$filename: $!"; open(my $fh, ">:utf8", $filename) or die "$filename: $!";
foreach my $var (LOCALCONFIG_VARS) { foreach my $var (LOCALCONFIG_VARS) {
my $name = $var->{name}; my $name = $var->{name};
my $desc = install_string("localconfig_$name", { root => ROOT_USER }); my $desc = $var->{desc};
chomp($desc); if(!length $desc){
# Make the description into a comment. $desc = install_string("localconfig_$name", { root => ROOT_USER });
$desc =~ s/^/# /mg; chomp($desc);
print $fh $desc, "\n", # Make the description into a comment.
$desc =~ s/^/# /mg;
$desc .= "\n";
}
print $fh $desc,
Data::Dumper->Dump([$localconfig->{$name}], Data::Dumper->Dump([$localconfig->{$name}],
["*$name"]), "\n"; ["*$name"]), "\n";
} }
...@@ -347,15 +351,16 @@ to access localconfig variables. ...@@ -347,15 +351,16 @@ to access localconfig variables.
=item C<LOCALCONFIG_VARS> =item C<LOCALCONFIG_VARS>
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. name - The name of the variable.
default - The default value for the variable. Should always be default - The default value for the variable. Should always be
something that can fit in a scalar. 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 definition. Must end in a newline. Each line should start
with "#" unless you have some REALLY good reason not with "#" unless you have some REALLY good reason not
to do that. to do that. If not present, the description is taken from
F<template/en/default/setup/strings.txt>.
=item C<OLD_LOCALCONFIG_VARS> =item C<OLD_LOCALCONFIG_VARS>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment