X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=lib%2FBackupPC%2FStorage%2FText.pm;h=24f02eb2a8897b300e56953d8ffaa2652dae259c;hp=fa46af2721c054192399ebe8d77b0a15b3447c1e;hb=82ffaa1c4130a34812fb241c2ea5cd3d0608bdab;hpb=31a7aca27ffd75e0aee9836704599cdb95dc2421 diff --git a/lib/BackupPC/Storage/Text.pm b/lib/BackupPC/Storage/Text.pm index fa46af2..24f02eb 100644 --- a/lib/BackupPC/Storage/Text.pm +++ b/lib/BackupPC/Storage/Text.pm @@ -12,7 +12,7 @@ # Craig Barratt # # COPYRIGHT -# Copyright (C) 2004 Craig Barratt +# Copyright (C) 2004-2007 Craig Barratt # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -30,7 +30,7 @@ # #======================================================================== # -# Version 3.0.0beta2, released 11 Nov 2006. +# Version 3.1.0beta0, released 3 Sep 2007. # # See http://backuppc.sourceforge.net. # @@ -84,6 +84,18 @@ sub BackupInfoRead close(BK_INFO); } close(LOCK); + # + # Default the version field. Prior to 3.0.0 the xferMethod + # field is empty, so we use that to figure out the version. + # + for ( my $i = 0 ; $i < @Backups ; $i++ ) { + next if ( $Backups[$i]{version} ne "" ); + if ( $Backups[$i]{xferMethod} eq "" ) { + $Backups[$i]{version} = "2.1.2"; + } else { + $Backups[$i]{version} = "3.0.0"; + } + } return @Backups; } @@ -279,6 +291,7 @@ sub ConfigDataRead } %$conf = ( %$conf, %Conf ); } + # # Promote BackupFilesOnly and BackupFilesExclude to hashes # @@ -306,6 +319,11 @@ sub ConfigDataRead delete($conf->{BlackoutWeekDays}); } + # + # Make sure IncrLevels is defined + # + $conf->{IncrLevels} = [1] if ( !defined($conf->{IncrLevels}) ); + return (undef, $conf); } @@ -344,8 +362,8 @@ sub ConfigFileMerge while ( ) { if ( /^\s*\$Conf\{([^}]*)\}\s*=(.*)/ ) { my $var = $1; + $skipExpr = "\$fakeVar = $2\n"; if ( exists($newConf->{$var}) ) { - $skipExpr = "\$fakeVar = $2\n"; my $d = Data::Dumper->new([$newConf->{$var}], [*value]); $d->Indent(1); $d->Terse(1); @@ -359,7 +377,9 @@ sub ConfigFileMerge } else { $contents .= $_; } - if ( defined($skipExpr) ) { + if ( defined($skipExpr) + && ($skipExpr =~ /^\$fakeVar = *<