1 --- generator.c 18 May 2004 08:50:17 -0000 1.85
2 +++ generator.c 5 Jun 2004 16:08:33 -0000
6 extern int relative_paths;
7 +extern int keep_dirlinks;
8 extern int preserve_links;
10 extern int preserve_devices;
11 @@ -302,6 +303,15 @@ void recv_generator(char *fname, struct
16 + if (statret == 0 && keep_dirlinks
17 + && S_ISLNK(st.st_mode) && S_ISDIR(file->mode)) {
19 + if (do_stat(fname, &st2) == 0 && S_ISDIR(st2.st_mode))
26 (S_ISDIR(st.st_mode) == S_ISDIR(file->mode))) {
27 @@ -338,9 +348,10 @@ void recv_generator(char *fname, struct
31 - /* f_out is set to -1 when doing final directory
32 - permission and modification time repair */
33 - if (set_perms(fname,file,NULL,0) && verbose && (f_out != -1))
34 + /* f_out is set to -1 when doing final directory-permission
35 + * and modification-time repair. */
36 + if (set_perms(fname, file, statret ? NULL : &st, 0)
37 + && verbose && f_out != -1)
38 rprintf(FINFO,"%s/\n",fname);
41 --- options.c 27 May 2004 21:51:53 -0000 1.153
42 +++ options.c 5 Jun 2004 16:08:34 -0000
43 @@ -38,6 +38,7 @@ int make_backups = 0;
47 +int keep_dirlinks = 0;
49 int preserve_links = 0;
50 int preserve_hard_links = 0;
51 @@ -232,6 +233,7 @@ void usage(enum logcode F)
52 rprintf(F," --backup-dir make backups into this directory\n");
53 rprintf(F," --suffix=SUFFIX backup suffix (default %s w/o --backup-dir)\n",BACKUP_SUFFIX);
54 rprintf(F," -u, --update update only (don't overwrite newer files)\n");
55 + rprintf(F," -K, --keep-dirlinks treat symlinked dir on receiver as dir\n");
56 rprintf(F," -l, --links copy symlinks as symlinks\n");
57 rprintf(F," -L, --copy-links copy the referent of all symlinks\n");
58 rprintf(F," --copy-unsafe-links copy the referent of \"unsafe\" symlinks\n");
59 @@ -338,6 +340,7 @@ static struct poptOption long_options[]
60 {"sparse", 'S', POPT_ARG_NONE, &sparse_files, 0, 0, 0 },
61 {"cvs-exclude", 'C', POPT_ARG_NONE, &cvs_exclude, 0, 0, 0 },
62 {"update", 'u', POPT_ARG_NONE, &update_only, 0, 0, 0 },
63 + {"keep-dirlinks", 'K', POPT_ARG_NONE, &keep_dirlinks, 0, 0, 0 },
64 {"links", 'l', POPT_ARG_NONE, &preserve_links, 0, 0, 0 },
65 {"copy-links", 'L', POPT_ARG_NONE, ©_links, 0, 0, 0 },
66 {"whole-file", 'W', POPT_ARG_VAL, &whole_file, 1, 0, 0 },
67 @@ -818,6 +821,8 @@ void server_options(char **args,int *arg
71 + if (keep_dirlinks && am_sender)
76 --- rsync.yo 21 May 2004 09:44:32 -0000 1.170
77 +++ rsync.yo 5 Jun 2004 16:08:35 -0000
78 @@ -289,6 +289,7 @@ verb(
79 --backup-dir make backups into this directory
80 --suffix=SUFFIX backup suffix (default ~ w/o --backup-dir)
81 -u, --update update only (don't overwrite newer files)
82 + -K, --keep-dirlinks treat symlinked dir on receiver as dir
83 -l, --links copy symlinks as symlinks
84 -L, --copy-links copy the referent of all symlinks
85 --copy-unsafe-links copy the referent of "unsafe" symlinks
86 @@ -479,6 +480,10 @@ symlink where the destination has a file
87 regardless of the timestamps. This might change in the future (feel
88 free to comment on this on the mailing list if you have an opinion).
90 +dit(bf(-K, --keep-dirlinks)) On the receiving side, if a symlink is
91 +pointing to a directory, it will be treated as matching a directory
94 dit(bf(-l, --links)) When symlinks are encountered, recreate the
95 symlink on the destination.