Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added --existing option, similar to one suggested by Gildas Quiniou <gildas@stip.fr>
[rsync/rsync.git]
/
generator.c
diff --git
a/generator.c
b/generator.c
index
3f6322f
..
cb63f72
100644
(file)
--- a/
generator.c
+++ b/
generator.c
@@
-178,6
+178,7
@@
void recv_generator(char *fname,struct file_list *flist,int i,int f_out)
extern char *compare_dest;
extern int list_only;
extern int preserve_perms;
extern char *compare_dest;
extern int list_only;
extern int preserve_perms;
+ extern int only_existing;
if (list_only) return;
if (list_only) return;
@@
-186,6
+187,12
@@
void recv_generator(char *fname,struct file_list *flist,int i,int f_out)
statret = link_stat(fname,&st);
statret = link_stat(fname,&st);
+ if (only_existing && statret == -1 && errno == ENOENT) {
+ /* we only want to update existing files */
+ if (verbose > 1) rprintf(FINFO,"not creating %s\n",fname);
+ return;
+ }
+
if (statret == 0 &&
!preserve_perms &&
(S_ISDIR(st.st_mode) == S_ISDIR(file->mode))) {
if (statret == 0 &&
!preserve_perms &&
(S_ISDIR(st.st_mode) == S_ISDIR(file->mode))) {