projects
/
BackupPC.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* On the phase 2 retry pass with rsync, verify the cached checksums
[BackupPC.git]
/
bin
/
BackupPC_tarExtract
diff --git
a/bin/BackupPC_tarExtract
b/bin/BackupPC_tarExtract
index
5c10cac
..
c18dc95
100755
(executable)
--- a/
bin/BackupPC_tarExtract
+++ b/
bin/BackupPC_tarExtract
@@
-27,7
+27,7
@@
#
#========================================================================
#
#
#========================================================================
#
-# Version 2.1.0beta
0, released 20 Ma
r 2004.
+# Version 2.1.0beta
1, released 9 Ap
r 2004.
#
# See http://backuppc.sourceforge.net.
#
#
# See http://backuppc.sourceforge.net.
#
@@
-115,6
+115,7
@@
my $ExistFileSize = 0;
my $ExistFileCompSize = 0;
my $TotalFileCnt = 0;
my $TotalFileSize = 0;
my $ExistFileCompSize = 0;
my $TotalFileCnt = 0;
my $TotalFileSize = 0;
+my $TarReadHdrCnt = 0;
sub TarRead
{
sub TarRead
{
@@
-128,6
+129,7
@@
sub TarRead
substr($data, $numBytes, $totBytes - $numBytes),
$totBytes - $numBytes);
if ( $newBytes <= 0 ) {
substr($data, $numBytes, $totBytes - $numBytes),
$totBytes - $numBytes);
if ( $newBytes <= 0 ) {
+ return if ( $TarReadHdrCnt == 1 ); # empty tar file ok
print("Unexpected end of tar archive (tot = $totBytes,"
. " num = $numBytes, posn = " . sysseek($fh, 0, 1) . ")\n");
$Abort = 1;
print("Unexpected end of tar archive (tot = $totBytes,"
. " num = $numBytes, posn = " . sysseek($fh, 0, 1) . ")\n");
$Abort = 1;
@@
-144,6
+146,7
@@
sub TarReadHeader
{
my($fh) = @_;
{
my($fh) = @_;
+ $TarReadHdrCnt++;
return $1 if ( TarRead($fh, $tar_header_length) =~ /(.*)/s );
return;
}
return $1 if ( TarRead($fh, $tar_header_length) =~ /(.*)/s );
return;
}
@@
-423,26
+426,30
@@
sub attributeWrite
my $poolWrite = BackupPC::PoolWrite->new($bpc, $fileName,
length($data), $Compress);
$poolWrite->write(\$data);
my $poolWrite = BackupPC::PoolWrite->new($bpc, $fileName,
length($data), $Compress);
$poolWrite->write(\$data);
- processClose($poolWrite, $Attrib{$d}->fileName($d), length($data));
+ processClose($poolWrite, $Attrib{$d}->fileName($d), length($data)
, 1
);
}
delete($Attrib{$d});
}
sub processClose
{
}
delete($Attrib{$d});
}
sub processClose
{
- my($poolWrite, $fileName, $origSize) = @_;
+ my($poolWrite, $fileName, $origSize
, $noStats
) = @_;
my($exists, $digest, $outSize, $errs) = $poolWrite->close;
if ( @$errs ) {
print(join("", @$errs));
$Errors += @$errs;
}
my($exists, $digest, $outSize, $errs) = $poolWrite->close;
if ( @$errs ) {
print(join("", @$errs));
$Errors += @$errs;
}
- $TotalFileCnt++;
- $TotalFileSize += $origSize;
+ if ( !$noStats ) {
+ $TotalFileCnt++;
+ $TotalFileSize += $origSize;
+ }
if ( $exists ) {
if ( $exists ) {
- $ExistFileCnt++;
- $ExistFileSize += $origSize;
- $ExistFileCompSize += $outSize;
+ if ( !$noStats ) {
+ $ExistFileCnt++;
+ $ExistFileSize += $origSize;
+ $ExistFileCompSize += $outSize;
+ }
} elsif ( $outSize > 0 ) {
print(NEW_FILES "$digest $origSize $fileName\n");
}
} elsif ( $outSize > 0 ) {
print(NEW_FILES "$digest $origSize $fileName\n");
}