The patches for 3.3.0.
[rsync-patches.git] / clone-dest.diff
index 08a8a72a59a23de50e375129adde5fc649e330d5..5ff5107df506084cc40346c97a6d061668352a89 100644 (file)
@@ -13,20 +13,20 @@ To use this patch, run these commands for a successful build:
     ./configure                         (optional if already run)
     make
 
-based-on: 35d4f6737a57c88978b6e954506e9c73f8c10ccf
+based-on: 6c8ca91c731b7bf2b081694bda85b7dadc2b7aff
 diff --git a/Makefile.in b/Makefile.in
 --- a/Makefile.in
 +++ b/Makefile.in
-@@ -50,7 +50,7 @@ popt_OBJS=popt/findme.o  popt/popt.o  popt/poptconfig.o \
+@@ -53,7 +53,7 @@ popt_OBJS=popt/findme.o  popt/popt.o  popt/poptconfig.o \
        popt/popthelp.o popt/poptparse.o
- OBJS=$(OBJS1) $(OBJS2) $(OBJS3) @SIMD@ $(DAEMON_OBJ) $(LIBOBJ) @BUILD_ZLIB@ @BUILD_POPT@
+ OBJS=$(OBJS1) $(OBJS2) $(OBJS3) $(DAEMON_OBJ) $(LIBOBJ) @BUILD_ZLIB@ @BUILD_POPT@
  
 -TLS_OBJ = tls.o syscall.o util2.o t_stub.o lib/compat.o lib/snprintf.o lib/permstring.o lib/sysxattrs.o @BUILD_POPT@
 +TLS_OBJ = tls.o syscall.o util1.o util2.o t_stub.o lib/compat.o lib/snprintf.o lib/permstring.o lib/sysxattrs.o lib/wildmatch.o @BUILD_POPT@
  
  # Programs we must have to run the test cases
  CHECK_PROGS = rsync$(EXEEXT) tls$(EXEEXT) getgroups$(EXEEXT) getfsdev$(EXEEXT) \
-@@ -155,7 +155,7 @@ getgroups$(EXEEXT): getgroups.o
+@@ -170,7 +170,7 @@ getgroups$(EXEEXT): getgroups.o
  getfsdev$(EXEEXT): getfsdev.o
        $(CC) $(CFLAGS) $(LDFLAGS) -o $@ getfsdev.o $(LIBS)
  
@@ -38,7 +38,7 @@ diff --git a/Makefile.in b/Makefile.in
 diff --git a/generator.c b/generator.c
 --- a/generator.c
 +++ b/generator.c
-@@ -957,7 +957,7 @@ static int try_dests_reg(struct file_struct *file, char *fname, int ndx,
+@@ -962,7 +962,7 @@ static int try_dests_reg(struct file_struct *file, char *fname, int ndx,
                        best_match = j;
                        match_level = 2;
                }
@@ -47,7 +47,7 @@ diff --git a/generator.c b/generator.c
                        best_match = j;
                        match_level = 3;
                        break;
-@@ -983,9 +983,16 @@ static int try_dests_reg(struct file_struct *file, char *fname, int ndx,
+@@ -988,9 +988,16 @@ static int try_dests_reg(struct file_struct *file, char *fname, int ndx,
                                goto got_nothing_for_ya;
                }
  #ifdef SUPPORT_HARD_LINKS
@@ -67,7 +67,7 @@ diff --git a/generator.c b/generator.c
                        if (atimes_ndx)
                                set_file_attrs(fname, file, sxp, NULL, 0);
                        if (preserve_hard_links && F_IS_HLINKED(file))
-@@ -1099,7 +1106,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx,
+@@ -1104,7 +1111,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx,
  
        if (match_level == 3) {
  #ifdef SUPPORT_HARD_LINKS
@@ -79,16 +79,16 @@ diff --git a/generator.c b/generator.c
 diff --git a/options.c b/options.c
 --- a/options.c
 +++ b/options.c
-@@ -573,7 +573,7 @@ enum {OPT_SERVER = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
+@@ -582,7 +582,7 @@ enum {OPT_SERVER = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
        OPT_INCLUDE, OPT_INCLUDE_FROM, OPT_MODIFY_WINDOW, OPT_MIN_SIZE, OPT_CHMOD,
        OPT_READ_BATCH, OPT_WRITE_BATCH, OPT_ONLY_WRITE_BATCH, OPT_MAX_SIZE,
        OPT_NO_D, OPT_APPEND, OPT_NO_ICONV, OPT_INFO, OPT_DEBUG, OPT_BLOCK_SIZE,
 -      OPT_USERMAP, OPT_GROUPMAP, OPT_CHOWN, OPT_BWLIMIT, OPT_STDERR,
 +      OPT_USERMAP, OPT_GROUPMAP, OPT_CHOWN, OPT_BWLIMIT, OPT_STDERR, OPT_CLONE_DEST,
-       OPT_OLD_COMPRESS, OPT_NEW_COMPRESS, OPT_NO_COMPRESS,
+       OPT_OLD_COMPRESS, OPT_NEW_COMPRESS, OPT_NO_COMPRESS, OPT_OLD_ARGS,
        OPT_STOP_AFTER, OPT_STOP_AT,
        OPT_REFUSED_BASE = 9000};
-@@ -733,6 +733,7 @@ static struct poptOption long_options[] = {
+@@ -743,6 +743,7 @@ static struct poptOption long_options[] = {
    {"compare-dest",     0,  POPT_ARG_STRING, 0, OPT_COMPARE_DEST, 0, 0 },
    {"copy-dest",        0,  POPT_ARG_STRING, 0, OPT_COPY_DEST, 0, 0 },
    {"link-dest",        0,  POPT_ARG_STRING, 0, OPT_LINK_DEST, 0, 0 },
@@ -96,7 +96,7 @@ diff --git a/options.c b/options.c
    {"fuzzy",           'y', POPT_ARG_NONE,   0, 'y', 0, 0 },
    {"no-fuzzy",         0,  POPT_ARG_VAL,    &fuzzy_basis, 0, 0, 0 },
    {"no-y",             0,  POPT_ARG_VAL,    &fuzzy_basis, 0, 0, 0 },
-@@ -986,6 +987,9 @@ static void set_refuse_options(void)
+@@ -1004,6 +1005,9 @@ static void set_refuse_options(void)
  #ifndef SUPPORT_HARD_LINKS
        parse_one_refuse_match(0, "link-dest", list_end);
  #endif
@@ -106,7 +106,7 @@ diff --git a/options.c b/options.c
  #ifndef HAVE_MKTIME
        parse_one_refuse_match(0, "stop-at", list_end);
  #endif
-@@ -1315,6 +1319,8 @@ char *alt_dest_opt(int type)
+@@ -1333,6 +1337,8 @@ char *alt_dest_opt(int type)
                return "--copy-dest";
        case LINK_DEST:
                return "--link-dest";
@@ -115,7 +115,7 @@ diff --git a/options.c b/options.c
        default:
                NOISY_DEATH("Unknown alt_dest_opt type");
        }
-@@ -1685,6 +1691,10 @@ int parse_arguments(int *argc_p, const char ***argv_p)
+@@ -1714,6 +1720,10 @@ int parse_arguments(int *argc_p, const char ***argv_p)
                        want_dest_type = LINK_DEST;
                        goto set_dest_dir;
  
@@ -129,7 +129,7 @@ diff --git a/options.c b/options.c
 diff --git a/rsync.1.md b/rsync.1.md
 --- a/rsync.1.md
 +++ b/rsync.1.md
-@@ -424,6 +424,7 @@ detailed description below for a complete description.
+@@ -510,6 +510,7 @@ has its own detailed description later in this manpage.
  --compare-dest=DIR       also compare destination files relative to DIR
  --copy-dest=DIR          ... and include copies of unchanged files
  --link-dest=DIR          hardlink to files in DIR when unchanged
@@ -137,18 +137,19 @@ diff --git a/rsync.1.md b/rsync.1.md
  --compress, -z           compress file data during the transfer
  --compress-choice=STR    choose the compression algorithm (aka --zc)
  --compress-level=NUM     explicitly set compression level (aka --zl)
-@@ -2347,6 +2348,17 @@ your home directory (remove the '=' for that).
-     specified (or implied by `-a`).  You can work-around this bug by avoiding
-     the `-o` option when sending to an old rsync.
+@@ -2720,6 +2721,18 @@ expand it.
+     this bug by avoiding the `-o` option (or using `--no-o`) when sending to an
+     old rsync.
  
 +0.  `--clone-dest=DIR`
 +
-+    This option behaves like `--link-dest`, but unchanged files are reflinked
-+    from _DIR_ to the destination directory.  The files do not need to match
-+    in attributes, as the data is cloned separately from the attributes.
++    This option behaves like [`--link-dest`](#opt), but unchanged files are
++    reflinked from _DIR_ to the destination directory.  The files do not need
++    to match in attributes, as the data is cloned separately from the
++    attributes.
 +
 +    If _DIR_ is a relative path, it is relative to the destination directory.
-+    See also `--compare-dest` and `--copy-dest`.
++    See also [`--compare-dest`](#opt) and [`--copy-dest`](#opt).
 +
 +    All non-regular files are hard-linked (when possible).
 +
@@ -231,7 +232,7 @@ diff --git a/syscall.c b/syscall.c
 diff --git a/t_stub.c b/t_stub.c
 --- a/t_stub.c
 +++ b/t_stub.c
-@@ -37,6 +37,7 @@ size_t max_alloc = 0; /* max_alloc is needed when combined with util2.o */
+@@ -38,6 +38,7 @@ size_t max_alloc = 0; /* max_alloc is needed when combined with util2.o */
  char *partial_dir;
  char *module_dir;
  filter_rule_list daemon_filter_list;