s/[\n\r]+$//;
if ( m/^DELETED\#(.+)$/ ) {
- my $path = $from_dir . $1;
+ my $path = $self->blob_path($data => $from_dir . $1 );
if ( -e $path ) {
- unlink $path && warn "unlink $path\n";
+ warn "UNLINK $path";
+ unlink $path || warn "ERROR: unlink $path $!";
+ next;
} else {
- warn "MISSING $path to unlink\n";
+ warn "MISSING $path to unlink";
next;
}
} elsif ( ! /^(MOVED|RENAMED)\#/ ) {
}
sub blob_path {
- my ( $self, $data ) = @_;
+ my ( $self, $data, $path ) = @_;
my $blob = $self->{pid}->{ $data->{pid} }->{dir} || die "no dir for $data->{pid} in ",dump( $self->{pid} );
- $blob .= '/' . $data->{file};
+ $blob .= '/' . ( defined $path ? $path : $data->{file} );
return $blob;
}
mkdir /tmp/test/$RSYNC_LOGIN2
RSYNC_PASSWORD=secret rsync -rv rsync://$RSYNC_LOGIN2@127.0.0.1:6501/$RSYNC_LOGIN2/received/ /tmp/test/$RSYNC_LOGIN2
+fi # skip tests
# test file move
-pending=/tmp/pending.0610201109464117
-grep ^MOVED $pending | cut -d\# -f2 | xargs -i sh -c "ps ax > {}"
-push . -rv
+ps ax > Jellyfish.jpg
+push Jellyfish.jpg
mkdir -p .sync/pending
-cp $pending .sync/pending/
+cat << __pending__ > .sync/pending/test
+MOVED#Jellyfish.jpg#Photos/Jellyfish.jpg
+DELETED#Photos/Jellyfish.jpg
+__pending__
+
push .sync -rv
+exit
ps ax > perms-test
chmod 400 perms-test
sudo sh -xc "ls -al ~$RSYNC_LOGIN/localhost/"
-pull
-fi # skip tests
-
find $SLICE/2001/ -type f | grep -v '/\.' | xargs md5sum | sort > /tmp/test/1
FULL=1 $base_dir/user-md5sum.pl u2001 | sort > /tmp/test/2