* Added Simplified Chinese CGI translation from Youlin Feng.
[BackupPC.git] / lib / BackupPC / Storage / Text.pm
index 4dea60e..b99648d 100644 (file)
@@ -84,6 +84,19 @@ sub BackupInfoRead
         close(BK_INFO);
     }
     close(LOCK);
+    #
+    # Default the level and version fields if not present
+    #
+    for ( my $i = 0 ; $i < @Backups ; $i++ ) {
+        if ( defined($Backups[$i]{level}) ) {
+            if ( !defined($Backups[$i]{version}) ) {
+                $Backups[$i]{version} = "3.0.0";
+            }
+        } else {
+            $Backups[$i]{level} = $Backups[$i]{type} eq "incr" ? 1 : 0;
+            $Backups[$i]{version} = "2.1.2";
+        }
+    }
     return @Backups;
 }
 
@@ -279,6 +292,7 @@ sub ConfigDataRead
         }
         %$conf = ( %$conf, %Conf );
     }
+
     #
     # Promote BackupFilesOnly and BackupFilesExclude to hashes
     #
@@ -306,6 +320,11 @@ sub ConfigDataRead
         delete($conf->{BlackoutWeekDays});
     }
 
+    #
+    # Make sure IncrLevels is defined
+    #
+    $conf->{IncrLevels} = [1] if ( !defined($conf->{IncrLevels}) );
+
     return (undef, $conf);
 }