aboutsummaryrefslogtreecommitdiffstats
path: root/generator.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2006-10-11 00:04:44 +0000
committerWayne Davison <wayned@samba.org>2006-10-11 00:04:44 +0000
commit1ef5bf3cfdcbad427ff201d476cd49c472ce58b7 (patch)
tree2492073cfd4ab3ed046ceaf2c41ea9a921034dea /generator.c
parent2a94207ad6f8671109db1e1b21ac1fa9eb3bde1e (diff)
downloadandroid_external_rsync-1ef5bf3cfdcbad427ff201d476cd49c472ce58b7.tar.gz
android_external_rsync-1ef5bf3cfdcbad427ff201d476cd49c472ce58b7.tar.bz2
android_external_rsync-1ef5bf3cfdcbad427ff201d476cd49c472ce58b7.zip
If new_root_dir is set, itemize the output of the "." dir as a
directory-creation event.
Diffstat (limited to 'generator.c')
-rw-r--r--generator.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/generator.c b/generator.c
index 15cd325e..1122c4f2 100644
--- a/generator.c
+++ b/generator.c
@@ -78,6 +78,7 @@ extern int copy_dest;
extern int link_dest;
extern int whole_file;
extern int list_only;
+extern int new_root_dir;
extern int read_batch;
extern int safe_symlinks;
extern long block_size; /* "long" because popt can't set an int32. */
@@ -913,8 +914,14 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
dry_run++;
}
if (itemizing && f_out != -1) {
- itemize(file, ndx, statret, &st,
- statret ? ITEM_LOCAL_CHANGE : 0, 0, NULL);
+ int sr = statret;
+ if (new_root_dir) {
+ if (*fname == '.' && fname[1] == '\0')
+ sr = -1;
+ new_root_dir = 0;
+ }
+ itemize(file, ndx, sr, &st,
+ sr ? ITEM_LOCAL_CHANGE : 0, 0, NULL);
}
if (statret != 0 && do_mkdir(fname,file->mode) < 0 && errno != EEXIST) {
if (!relative_paths || errno != ENOENT