Updated to apply cleanly.
[rsync-patches.git] / chmod-option.diff
index 599bd599f9a685b2371391d37ca45187195bcc73..af2df00190336aad10c9222ed36de59ea113183c 100644 (file)
@@ -4,7 +4,7 @@ command before "make":
     make proto
 
 
---- orig/Makefile.in   2004-11-03 11:56:03
+--- orig/Makefile.in   2004-11-02 16:47:15
 +++ Makefile.in        2004-07-03 20:13:41
 @@ -34,7 +34,7 @@ ZLIBOBJ=zlib/deflate.o zlib/infblock.o z
  OBJS1=rsync.o generator.o receiver.o cleanup.o sender.o exclude.o util.o \
@@ -202,9 +202,9 @@ command before "make":
 +      }
 +      return 0;
 +}
---- orig/flist.c       2005-02-20 00:16:35
+--- orig/flist.c       2005-04-28 15:56:50
 +++ flist.c    2004-09-18 01:51:11
-@@ -65,6 +65,8 @@ extern char *log_format;
+@@ -62,6 +62,8 @@ extern struct file_list *the_file_list;
  
  extern char curr_dir[MAXPATHLEN];
  
@@ -213,7 +213,7 @@ command before "make":
  extern struct filter_list_struct filter_list;
  extern struct filter_list_struct server_filter_list;
  
-@@ -882,7 +884,10 @@ skip_filters:
+@@ -883,7 +885,10 @@ skip_filters:
        file->flags = flags;
        file->modtime = st.st_mtime;
        file->length = st.st_size;
@@ -225,9 +225,9 @@ command before "make":
        file->uid = st.st_uid;
        file->gid = st.st_gid;
  
---- orig/options.c     2005-02-20 00:02:23
-+++ options.c  2005-02-16 15:38:40
-@@ -132,6 +132,7 @@ char *log_format = NULL;
+--- orig/options.c     2005-05-03 16:47:32
++++ options.c  2005-03-01 01:26:56
+@@ -141,6 +141,7 @@ char *log_format = NULL;
  char *password_file = NULL;
  char *rsync_path = RSYNC_PATH;
  char *backup_dir = NULL;
@@ -235,7 +235,7 @@ command before "make":
  char backup_dir_buf[MAXPATHLEN];
  int rsync_port = 0;
  int compare_dest = 0;
-@@ -151,6 +152,8 @@ int list_only = 0;
+@@ -160,6 +161,8 @@ int list_only = 0;
  #define MAX_BATCH_NAME_LEN 256        /* Must be less than MAXPATHLEN-13 */
  char *batch_name = NULL;
  
@@ -244,7 +244,7 @@ command before "make":
  static int daemon_opt;   /* sets am_daemon after option error-reporting */
  static int F_option_cnt = 0;
  static int modify_window_set;
-@@ -278,6 +281,7 @@ void usage(enum logcode F)
+@@ -287,6 +290,7 @@ void usage(enum logcode F)
    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");
@@ -252,17 +252,17 @@ command before "make":
    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 files whole (without rsync algorithm)\n");
-@@ -396,6 +400,7 @@ static struct poptOption long_options[] 
+@@ -411,6 +415,7 @@ static struct poptOption long_options[] 
    {"perms",           'p', POPT_ARG_NONE,   &preserve_perms, 0, 0, 0 },
    {"owner",           'o', POPT_ARG_NONE,   &preserve_uid, 0, 0, 0 },
    {"group",           'g', POPT_ARG_NONE,   &preserve_gid, 0, 0, 0 },
 +  {"chmod",            0,  POPT_ARG_STRING, &chmod_mode, 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 },
-@@ -1067,6 +1072,13 @@ int parse_arguments(int *argc, const cha
-               return 0;
-       }
+   {"omit-dir-times",  'O', POPT_ARG_VAL,    &omit_dir_times, 2, 0, 0 },
+@@ -1096,6 +1101,13 @@ int parse_arguments(int *argc, const cha
+       if (make_backups && !backup_dir)
+               omit_dir_times = 1;
  
 +      if (chmod_mode && !(chmod_modes = parse_chmod(chmod_mode))) {
 +              snprintf(err_buf, sizeof err_buf,
@@ -272,9 +272,9 @@ command before "make":
 +      }
 +
        if (log_format) {
-               if (strstr(log_format, "%i") != NULL)
+               if (log_format_has(log_format, 'i'))
                        log_format_has_i = 1;
-@@ -1416,6 +1428,11 @@ void server_options(char **args,int *arg
+@@ -1462,6 +1474,11 @@ void server_options(char **args,int *arg
                }
        }
  
@@ -283,12 +283,12 @@ command before "make":
 +              args[ac++] = chmod_mode;
 +      }
 +
-       if (files_from && (!am_sender || remote_filesfrom_file)) {
-               if (remote_filesfrom_file) {
+       if (files_from && (!am_sender || filesfrom_host)) {
+               if (filesfrom_host) {
                        args[ac++] = "--files-from";
---- orig/rsync.yo      2005-02-19 09:27:49
+--- orig/rsync.yo      2005-05-03 16:47:33
 +++ rsync.yo   2005-01-24 01:48:43
-@@ -322,6 +322,7 @@ to the detailed description below for a 
+@@ -330,6 +330,7 @@ to the detailed description below for a 
   -D, --devices               preserve devices (root only)
   -t, --times                 preserve times
   -O, --omit-dir-times        omit directories when preserving times
@@ -296,9 +296,9 @@ command before "make":
   -S, --sparse                handle sparse files efficiently
   -n, --dry-run               show what would have been transferred
   -W, --whole-file            copy files whole (without rsync algorithm)
-@@ -653,6 +654,14 @@ dit(bf(-O, --omit-dir-times)) This tells
- it is preserving modification times (see bf(--times)).  If NFS is sharing
+@@ -667,6 +668,14 @@ it is preserving modification times (see
  the directories on the receiving side, it is a good idea to use bf(-O).
+ This option is inferred if you use bf(--backup) without bf(--backup-dir).
  
 +dit(bf(--chmod)) This options tells rsync to apply the listed "chmod" pattern
 +to the permission of the files on the destination.  In addition to the normal