Applied to the trunk.
authorWayne Davison <wayned@samba.org>
Mon, 24 Jan 2005 00:52:45 +0000 (00:52 +0000)
committerWayne Davison <wayned@samba.org>
Mon, 24 Jan 2005 00:52:45 +0000 (00:52 +0000)
omit-dir-times.diff [deleted file]

diff --git a/omit-dir-times.diff b/omit-dir-times.diff
deleted file mode 100644 (file)
index ccf72d1..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
---- orig/options.c     2005-01-24 00:18:21
-+++ options.c  2004-12-03 23:24:19
-@@ -48,6 +48,7 @@ int preserve_devices = 0;
- int preserve_uid = 0;
- int preserve_gid = 0;
- int preserve_times = 0;
-+int omit_dir_times = 0;
- int update_only = 0;
- int cvs_exclude = 0;
- int dry_run = 0;
-@@ -263,6 +264,7 @@ void usage(enum logcode F)
-   rprintf(F," -g, --group                 preserve group\n");
-   rprintf(F," -D, --devices               preserve devices (root only)\n");
-   rprintf(F," -t, --times                 preserve times\n");
-+  rprintf(F," -O, --omit-dir-times        omit directories when preserving times\n");
-   rprintf(F," -S, --sparse                handle sparse files efficiently\n");
-   rprintf(F," -n, --dry-run               show what would have been transferred\n");
-   rprintf(F," -W, --whole-file            copy whole files, no incremental checks\n");
-@@ -370,6 +372,7 @@ static struct poptOption long_options[] 
-   {"group",           'g', POPT_ARG_NONE,   &preserve_gid, 0, 0, 0 },
-   {"devices",         'D', POPT_ARG_NONE,   &preserve_devices, 0, 0, 0 },
-   {"times",           't', POPT_ARG_NONE,   &preserve_times, 0, 0, 0 },
-+  {"omit-dir-times",  'O', POPT_ARG_NONE,   &omit_dir_times, 0, 0, 0 },
-   {"checksum",        'c', POPT_ARG_NONE,   &always_checksum, 0, 0, 0 },
-   {"verbose",         'v', POPT_ARG_NONE,   0, 'v', 0, 0 },
-   {"quiet",           'q', POPT_ARG_NONE,   0, 'q', 0, 0 },
-@@ -1082,6 +1085,8 @@ void server_options(char **args,int *arg
-               argstr[x++] = 'D';
-       if (preserve_times)
-               argstr[x++] = 't';
-+      if (omit_dir_times && am_sender)
-+              argstr[x++] = 'O';
-       if (preserve_perms)
-               argstr[x++] = 'p';
-       if (recurse < 0)
---- orig/rsync.c       2005-01-20 23:52:09
-+++ rsync.c    2004-12-03 23:32:45
-@@ -25,6 +25,7 @@
- extern int verbose;
- extern int dry_run;
- extern int preserve_times;
-+extern int omit_dir_times;
- extern int am_root;
- extern int am_sender;
- extern int am_generator;
-@@ -165,14 +166,12 @@ int set_perms(char *fname,struct file_st
-       }
-       if (!preserve_times || S_ISLNK(st->st_mode)
--          || (make_backups && !backup_dir && S_ISDIR(st->st_mode)))
-+       || (S_ISDIR(st->st_mode)
-+        && (omit_dir_times || (make_backups && !backup_dir))))
-               flags |= PERMS_SKIP_MTIME;
-       if (!(flags & PERMS_SKIP_MTIME)
-           && cmp_modtime(st->st_mtime, file->modtime) != 0) {
--              /* don't complain about not setting times on directories
--               * because some filesystems can't do it */
--              if (set_modtime(fname,file->modtime) != 0 &&
--                  !S_ISDIR(st->st_mode)) {
-+              if (set_modtime(fname,file->modtime) != 0) {
-                       rsyserr(FERROR, errno, "failed to set times on %s",
-                               full_fname(fname));
-                       return 0;
---- orig/rsync.yo      2005-01-24 00:18:21
-+++ rsync.yo   2004-12-03 23:28:07
-@@ -331,6 +331,7 @@ verb(
-  -g, --group                 preserve group
-  -D, --devices               preserve devices (root only)
-  -t, --times                 preserve times
-+ -O, --omit-dir-times        omit directories when preserving times
-  -S, --sparse                handle sparse files efficiently
-  -n, --dry-run               show what would have been transferred
-  -W, --whole-file            copy whole files, no incremental checks
-@@ -638,6 +639,10 @@ cause the next transfer to behave as if 
- updated (though the rsync algorithm will make the update fairly efficient
- if the files haven't actually changed, you're much better off using -t).
-+dit(bf(-O, --omit-dir-times)) This tells rsync to omit directories when
-+the preserving of modification times is enabled (see --times).  If NFS
-+is sharing the files on the receiving end, it is a good idea to use -O.
-+
- dit(bf(-n, --dry-run)) This tells rsync to not do any file transfers,
- instead it will just report the actions it would have taken.