]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1269160 - Localconfig.pm: LOCALCONFIG_VARS docs and functionality loss
authorKenneth Lorber <keni@his.com>
Thu, 12 May 2016 19:17:58 +0000 (15:17 -0400)
committerDylan Hardison <dylan@mozilla.com>
Thu, 12 May 2016 19:18:40 +0000 (15:18 -0400)
r=dylan

Bugzilla/Install/Localconfig.pm

index d5de236e0313eefa6c445121ab9955755b4fcaf1..82ec9ae35e9a22b6d2cca5871f5a5a2001223c95 100644 (file)
@@ -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<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.
  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<template/en/default/setup/strings.txt>.
 
 =item C<OLD_LOCALCONFIG_VARS>