summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2009-02-23 23:52:00 +0000
committerivan <ivan>2009-02-23 23:52:00 +0000
commit024d4735a2894915bb36e9926fa0d0af26c2beee (patch)
tree6e93fc597c398f5e31ee367f2c8bcab05e373e0b /FS
parent91de9d1c2ce49b3044d4bc98ef400ff4825f0c34 (diff)
fix 1.7 -> 1.9 config upgrade for new "image" config type
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/Conf.pm29
1 files changed, 16 insertions, 13 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index 39ab389e7..8c5b296e0 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -334,7 +334,7 @@ sub import_config_item {
warn "Inserting $key\n" if $DEBUG;
local $/;
my $value = readline(new IO::File "$dir/$key");
- if ($item->type eq 'binary') {
+ if ($item->type =~ /^(binary|image)$/ ) {
$self->set_binary($key, $value);
}else{
$self->set($key, $value);
@@ -363,7 +363,8 @@ sub verify_config_item {
$error .= "$key fails existential comparison; "
if $self->exists($key) xor $compat->exists($key);
- unless ($type eq 'binary') {
+ if ( $type !~ /^(binary|image)$/ ) {
+
{
no warnings;
$error .= "$key fails scalar comparison; "
@@ -380,22 +381,24 @@ sub verify_config_item {
$error .= "$key fails list comparison; "
unless $r;
}
- }
- if ($type eq 'binary') {
+ } else {
+
$error .= "$key fails binary comparison; "
unless scalar($self->config_binary($key)) eq scalar($compat->config_binary($key));
- }
- if ($error =~ /existential comparison/ && $item->section eq 'deprecated') {
- my $proto;
- for ( @config_items ) { $proto = $_; last if $proto->key eq $key; }
- unless ($proto->key eq $key) {
- warn "removed config item $error\n" if $DEBUG;
- $error = '';
- }
}
+#remove deprecated config on our own terms, not freeside-upgrade's
+# if ($error =~ /existential comparison/ && $item->section eq 'deprecated') {
+# my $proto;
+# for ( @config_items ) { $proto = $_; last if $proto->key eq $key; }
+# unless ($proto->key eq $key) {
+# warn "removed config item $error\n" if $DEBUG;
+# $error = '';
+# }
+# }
+
$error;
}
@@ -479,7 +482,7 @@ sub config_items {
=item init-config DIR
-Imports the non-deprecated configuration items from DIR (1.7 compatible)
+Imports the configuration items from DIR (1.7 compatible)
to conf records in the database.
=cut