added DELETED pending log
[cloudstore.git] / lib / CloudStore / Store.pm
index 42d2db9..68358d8 100644 (file)
@@ -85,8 +85,15 @@ sub modify_file {
                open(my $pend, '<', $self->blob_path($data) );
                while(<$pend>) {
                        s/[\n\r]+$//;
-warn $_;
-                       if ( ! /^(MOVED|RENAMED)\#/ ) {
+
+                       if ( m/^DELETED\#(.+)$/ ) {
+                               my $path = $from_dir . $1;
+                               if ( -e $path ) {
+                                       unlink $path && warn "unlink $path\n";
+                               } else {
+                                       warn "MISSING $path to unlink\n";
+                               }
+                       } elsif ( ! /^(MOVED|RENAMED)\#/ ) {
                                warn "skip $_\n";
                                next;
                        }