projects
/
cloudstore.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
799c536
)
json_path -> path
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 19 Jul 2011 17:02:56 +0000
(17:02 +0000)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 19 Jul 2011 17:02:56 +0000
(17:02 +0000)
lib/CloudStore/JSON.pm
patch
|
blob
|
history
diff --git
a/lib/CloudStore/JSON.pm
b/lib/CloudStore/JSON.pm
index
5a3c1ff
..
8e54894
100644
(file)
--- a/
lib/CloudStore/JSON.pm
+++ b/
lib/CloudStore/JSON.pm
@@
-35,28
+35,28
@@
sub rsync_transfer {
my ( $data ) = @_;
my $json = encode_json $data;
my ( $data ) = @_;
my $json = encode_json $data;
- my $
json_
path = "users/$data->{login}/json/$data->{file}";
+ my $path = "users/$data->{login}/json/$data->{file}";
if ( $data->{itemize} =~ m/^[c>]([fd])/ ) { # received change/create
my $type = $1;
if ( $data->{itemize} =~ m/^[c>]([fd])/ ) { # received change/create
my $type = $1;
- if ( -e $
json_
path ) {
- modify_existing $
json_
path;
+ if ( -e $path ) {
+ modify_existing $path;
return $json;
}
if ( $type eq 'f' ) {
return $json;
}
if ( $type eq 'f' ) {
- if ( $
json_
path =~ m{^(.+)/[^/]+$} ) { # have dir
+ if ( $path =~ m{^(.+)/[^/]+$} ) { # have dir
make_path $1 if ! -e $1;
}
make_path $1 if ! -e $1;
}
- write_file $
json_
path, $json;
+ write_file $path, $json;
} elsif ( $type eq 'd' ) {
} elsif ( $type eq 'd' ) {
- make_path $
json_
path;
+ make_path $path;
}
} elsif ( $data->{itemize} =~ m/\*deleting/ ) {
}
} elsif ( $data->{itemize} =~ m/\*deleting/ ) {
- if ( -d $
json_
path ) {
- remove_path $
json_
path;
- } elsif ( -f $
json_
path ) {
- remove_file $
json_
path;
+ if ( -d $path ) {
+ remove_path $path;
+ } elsif ( -f $path ) {
+ remove_file $path;
}
}
return $json;
}
}
return $json;