r11658@llin: dpavlin | 2005-12-13 02:10:39 +0100
authordpavlin <dpavlin@8392b6e1-25fa-0310-8288-cc32f8e212ea>
Tue, 13 Dec 2005 00:10:48 +0000 (00:10 +0000)
committerdpavlin <dpavlin@8392b6e1-25fa-0310-8288-cc32f8e212ea>
Tue, 13 Dec 2005 00:10:48 +0000 (00:10 +0000)
 tar_size in database can be larger than generated because it takes into
 account padding which occurs in tar file. Since this is check anyway,
 it's aproximated here.

git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/BackupPC/trunk@265 8392b6e1-25fa-0310-8288-cc32f8e212ea

bin/BackupPC_incPartsUpdate

index d1ce404..d7ef2ec 100755 (executable)
@@ -114,7 +114,7 @@ sub tar_check($$$$) {
 
                if (my $row = $sth_md5->fetchrow_hashref) {
                        return if (
-                               $row->{tar_size} == $tar_size &&
+                               $row->{tar_size} >= $tar_size &&
                                $row->{size} == $size &&
                                $row->{md5} eq $md5 &&
                                $row->{items} == $items
@@ -177,6 +177,7 @@ sub tar_check($$$$) {
                }
 
                my $md5 = read_file( $md5_path ) || die "can't read md5sum file $md5_path: $!";
+               $md5 =~ s#\s.*$##;
 
                my $part_nr = 1;
                $part_nr = $1 if ($tarfilename =~ m#/(\d+)\.tar\.gz#);