diff options
author | lpsolit%gmail.com <> | 2007-06-14 23:30:30 +0200 |
---|---|---|
committer | lpsolit%gmail.com <> | 2007-06-14 23:30:30 +0200 |
commit | 8240cb081019b781ea50e5cad84089754ad316c4 (patch) | |
tree | 0bff4b7eb2c87dc453049b6521c84792112c356e /Bugzilla/Config.pm | |
parent | 80c5b6fadda4e77e5a48cd50e55cbe710a31ca83 (diff) | |
download | bugzilla-8240cb081019b781ea50e5cad84089754ad316c4.tar.gz bugzilla-8240cb081019b781ea50e5cad84089754ad316c4.tar.xz |
Bug 345100: Remove obsolete parameters and "officially" turn on custom bug status workflow - Patch by Frédéric Buclin <LpSolit@gmail.com> r=gerv a=justdave
Diffstat (limited to 'Bugzilla/Config.pm')
-rw-r--r-- | Bugzilla/Config.pm | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/Bugzilla/Config.pm b/Bugzilla/Config.pm index 85c9d6dec..fe58e0282 100644 --- a/Bugzilla/Config.pm +++ b/Bugzilla/Config.pm @@ -199,18 +199,16 @@ sub update_params { # --- REMOVE OLD PARAMS --- - my @oldparams; + my %oldparams; # Remove any old params, put them in old-params.txt foreach my $item (keys %$param) { if (!grep($_ eq $item, map ($_->{'name'}, @param_list))) { - local $Data::Dumper::Terse = 1; - local $Data::Dumper::Indent = 0; - push (@oldparams, [$item, Data::Dumper->Dump([$param->{$item}])]); + $oldparams{$item} = $param->{$item}; delete $param->{$item}; } } - if (@oldparams) { + if (scalar(keys %oldparams)) { my $op_file = new IO::File('old-params.txt', '>>', 0600) || die "old-params.txt: $!"; @@ -218,11 +216,14 @@ sub update_params { " and so have been\nmoved from your parameters file into", " old-params.txt:\n"; - foreach my $p (@oldparams) { - my ($item, $value) = @$p; - print $op_file "\n\n$item:\n$value\n"; - print $item; - print ", " unless $item eq $oldparams[$#oldparams]->[0]; + local $Data::Dumper::Terse = 1; + local $Data::Dumper::Indent = 0; + + my $comma = ""; + foreach my $item (keys %oldparams) { + print $op_file "\n\n$item:\n" . Data::Dumper->Dump([$oldparams{$item}]) . "\n"; + print "${comma}$item"; + $comma = ", "; } print "\n"; $op_file->close; @@ -250,6 +251,10 @@ sub update_params { } write_params($param); + + # Return deleted params and values so that checksetup.pl has a chance + # to convert old params to new data. + return %oldparams; } sub write_params { |