#
#========================================================================
#
-# Version 2.1.0, released 20 Jun 2004.
+# Version 3.0.0alpha, released 23 Jan 2006.
#
# See http://backuppc.sourceforge.net.
#
my $fio = bless {
blockSize => 700,
logLevel => 0,
- digest => File::RsyncP::Digest->new($options->{protocol_version}),
+ digest => File::RsyncP::Digest->new(),
checksumSeed => 0,
attrib => {},
logHandler => \&logHandler,
%$options,
}, $class;
+ $fio->{digest}->protocol($fio->{protocol_version});
$fio->{shareM} = $fio->{bpc}->fileNameEltMangle($fio->{share});
$fio->{outDir} = "$fio->{xfer}{outDir}/new/";
$fio->{outDirSh} = "$fio->{outDir}/$fio->{shareM}/";
my($fio, $d) = @_;
my($poolWrite);
+ #
+ # Don't write attributes on 2nd phase - they're already
+ # taken care of during the first phase.
+ #
+ return if ( $fio->{phase} > 0 );
if ( !defined($d) ) {
#
# flush all entries (in reverse order)
$fio->logFileAction("skip", {
%{$fio->{viewCache}{$d}{$f}},
name => $name,
- }) if ( $fio->{logLevel} >= 2 );
+ }) if ( $fio->{logLevel} >= 2
+ && $a->{type} == BPC_FTYPE_FILE );
}
} elsif ( !$fio->{full} ) {
##print("Delete file $f\n");
my $owner = "$f->{uid}/$f->{gid}";
my $type = (("", "p", "c", "", "d", "", "b", "", "", "", "l", "", "s"))
[($f->{mode} & S_IFMT) >> 12];
- my $link;
+ my $name = $f->{name};
if ( ($f->{mode} & S_IFMT) == S_IFLNK ) {
- $link = " -> $f->{link}";
- } if ( ($f->{mode} & S_IFMT) == S_IFREG
+ $name .= " -> $f->{link}";
+ } elsif ( ($f->{mode} & S_IFMT) == S_IFREG
&& defined($f->{hlink}) && !$f->{hlink_self} ) {
- $link = " -> $f->{hlink}";
+ $name .= " -> $f->{hlink}";
}
+ $name =~ s/\n/\\n/g;
- $fio->log(sprintf(" %-6s %1s%4o %9s %11.0f %s%s",
+ $fio->log(sprintf(" %-6s %1s%4o %9s %11.0f %s",
$action,
$type,
$f->{mode} & 07777,
$owner,
$f->{size},
- $f->{name},
- $link));
+ $name));
}
#
if ( $fio->{logLevel} >= 9 );
$fio->{rxOutFile} = $rxOutFile;
$fio->{rxOutFileRel} = $rxOutFileRel;
- $fio->{rxDigest} = File::RsyncP::Digest->new($fio->{protocol_version});
+ $fio->{rxDigest} = File::RsyncP::Digest->new();
+ $fio->{rxDigest}->protocol($fio->{protocol_version});
$fio->{rxDigest}->add(pack("V", $fio->{checksumSeed}));
}
if ( defined($fio->{rxMatchBlk})
close($fio->{rxInFd}) if ( defined($fio->{rxInFd}) );
unlink("$fio->{outDirSh}RStmp") if ( -f "$fio->{outDirSh}RStmp" );
+ $fio->{phase} = $phase;
#
# Check the final md4 digest
#
# Empty file; just create an empty file digest
#
- $fio->{rxDigest} = File::RsyncP::Digest->new($fio->{protocol_version});
+ $fio->{rxDigest} = File::RsyncP::Digest->new();
+ $fio->{rxDigest}->protocol($fio->{protocol_version});
$fio->{rxDigest}->add(pack("V", $fio->{checksumSeed}));
$newDigest = $fio->{rxDigest}->digest;
}