[Rt-commit] rt branch, 4.0/installer-skip-writing-some-values, created. rt-4.0.6-300-gb538cf3

Alex Vandiver alexmv at bestpractical.com
Tue Aug 21 18:02:09 EDT 2012


The branch, 4.0/installer-skip-writing-some-values has been created
        at  b538cf3661fcff262f1c68df29324c99a5c354fb (commit)

- Log -----------------------------------------------------------------
commit 5cfdf4ad743840592ec00e7662ffecdbefdafde2
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Aug 21 18:00:16 2012 -0400

    Skip writing DatabaseAdmin and DatabaseAdminPassword keys

diff --git a/lib/RT/Installer.pm b/lib/RT/Installer.pm
index d12abb6..b8fb2eb 100644
--- a/lib/RT/Installer.pm
+++ b/lib/RT/Installer.pm
@@ -97,6 +97,7 @@ my %Meta = (
         },
     },
     DatabaseAdmin => {
+        SkipWrite       => 1,
         Widget          => '/Widgets/Form/String',
         WidgetArguments => {
             Default => 1,
@@ -106,6 +107,7 @@ my %Meta = (
         },
     },
     DatabaseAdminPassword => {
+        SkipWrite       => 1,
         Widget          => '/Widgets/Form/String',
         WidgetArguments => {
             Description => 'DBA password',  #loc
@@ -149,6 +151,7 @@ my %Meta = (
         },
     },
     Password => {
+        SkipWrite       => 1,
         Widget          => '/Widgets/Form/String',
         WidgetArguments => {
             Description => 'Administrative password', #loc
@@ -277,7 +280,7 @@ sub SaveConfig {
         for ( keys %{ $RT::Installer->{InstallConfig} } ) {
 
             # we don't want to store root's password in config.
-            next if $_ eq 'Password';
+            next if $class->Meta($_) and $class->Meta($_)->{SkipWrite};
 
             $RT::Installer->{InstallConfig}{$_} = ''
               unless defined $RT::Installer->{InstallConfig}{$_};

commit b538cf3661fcff262f1c68df29324c99a5c354fb
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Aug 21 18:00:22 2012 -0400

    Make ordering of written config keys consistent, at least

diff --git a/lib/RT/Installer.pm b/lib/RT/Installer.pm
index b8fb2eb..e7c3b71 100644
--- a/lib/RT/Installer.pm
+++ b/lib/RT/Installer.pm
@@ -277,7 +277,7 @@ sub SaveConfig {
       $RT::Installer->{InstallConfig}{rtname};
 
     if ( open my $fh, '>', $file ) {
-        for ( keys %{ $RT::Installer->{InstallConfig} } ) {
+        for ( sort keys %{ $RT::Installer->{InstallConfig} } ) {
 
             # we don't want to store root's password in config.
             next if $class->Meta($_) and $class->Meta($_)->{SkipWrite};

-----------------------------------------------------------------------


More information about the Rt-commit mailing list