This patch provides --flags, which preserves the st_flags field.
-Modified from a patch that was written by Rolf Grossmann:
+Modified from a patch that was written by Rolf Grossmann.
- http://www.progtech.net/rsync.flags-patch
+To use this patch, run these commands for a successful build:
+
+ patch -p1 <patches/flags.diff
+ ./prepare-source
+ ./configure
+ make
--- old/configure.in
+++ new/configure.in
return;
if (!S_ISLNK(st.st_mode))
statret = -1;
-@@ -1060,7 +1076,7 @@ static void recv_generator(char *fname,
+@@ -1063,7 +1079,7 @@ static void recv_generator(char *fname,
|| (st.st_mode & ~CHMOD_BITS) != (file->mode & ~CHMOD_BITS)
|| st.st_rdev != file->u.rdev) {
if (statret == 0
return;
if (preserve_hard_links && file->link_u.links
&& hard_link_check(file, ndx, fname, -1, &st,
-@@ -1145,7 +1161,7 @@ static void recv_generator(char *fname,
+@@ -1148,7 +1164,7 @@ static void recv_generator(char *fname,
fnamecmp_type = FNAMECMP_FNAME;
if (statret == 0 && !S_ISREG(st.st_mode)) {
int preserve_executability = 0;
int preserve_devices = 0;
int preserve_specials = 0;
-@@ -200,6 +201,7 @@ static void print_rsync_version(enum log
+@@ -201,6 +202,7 @@ static void print_rsync_version(enum log
char const *hardlinks = "no ";
char const *links = "no ";
char const *ipv6 = "no ";
STRUCT_STAT *dumstat;
#ifdef HAVE_SOCKETPAIR
-@@ -222,6 +224,10 @@ static void print_rsync_version(enum log
+@@ -223,6 +225,10 @@ static void print_rsync_version(enum log
ipv6 = "";
#endif
rprintf(f, "%s version %s protocol version %d\n",
RSYNC_NAME, RSYNC_VERSION, PROTOCOL_VERSION);
rprintf(f, "Copyright (C) 1996-2006 by Andrew Tridgell, Wayne Davison, and others.\n");
-@@ -234,9 +240,9 @@ static void print_rsync_version(enum log
+@@ -235,9 +241,9 @@ static void print_rsync_version(enum log
/* Note that this field may not have type ino_t. It depends
* on the complicated interaction between largefile feature
* macros. */
(int) (sizeof dumstat->st_ino * 8),
(int) (sizeof (int64) * 8));
#ifdef MAINTAINER_MODE
-@@ -302,6 +308,7 @@ void usage(enum logcode F)
+@@ -304,6 +310,7 @@ void usage(enum logcode F)
rprintf(F," -K, --keep-dirlinks treat symlinked dir on receiver as dir\n");
rprintf(F," -H, --hard-links preserve hard links\n");
rprintf(F," -p, --perms preserve permissions\n");
rprintf(F," -E, --executability preserve the file's executability\n");
rprintf(F," --chmod=CHMOD affect file and/or directory permissions\n");
rprintf(F," -o, --owner preserve owner (super-user only)\n");
-@@ -420,6 +427,8 @@ static struct poptOption long_options[]
+@@ -424,6 +431,8 @@ static struct poptOption long_options[]
{"perms", 'p', POPT_ARG_VAL, &preserve_perms, 1, 0, 0 },
{"no-perms", 0, POPT_ARG_VAL, &preserve_perms, 0, 0, 0 },
{"no-p", 0, POPT_ARG_VAL, &preserve_perms, 0, 0, 0 },
{"executability", 'E', POPT_ARG_NONE, &preserve_executability, 0, 0, 0 },
{"times", 't', POPT_ARG_VAL, &preserve_times, 1, 0, 0 },
{"no-times", 0, POPT_ARG_VAL, &preserve_times, 0, 0, 0 },
-@@ -1124,6 +1133,15 @@ int parse_arguments(int *argc, const cha
+@@ -1128,6 +1137,15 @@ int parse_arguments(int *argc, const cha
}
#endif
if (write_batch && read_batch) {
snprintf(err_buf, sizeof err_buf,
"--write-batch and --read-batch can not be used together\n");
-@@ -1577,6 +1595,9 @@ void server_options(char **args,int *arg
+@@ -1581,6 +1599,9 @@ void server_options(char **args,int *arg
if (xfer_dirs && !recurse && delete_mode && am_sender)
args[ac++] = "--no-r";
ok_to_set_time ? 0 : ATTRS_SKIP_MTIME);
+#ifdef SUPPORT_FLAGS
-+ make_mutable(fname, file->mode, file->fileflags);
++ make_mutable(fnametmp, file->mode, file->fileflags);
+#endif
/* move tmp file over real file */
if (verbose > 2)
mode_t mode;
--- old/rsync.yo
+++ new/rsync.yo
-@@ -320,6 +320,7 @@ to the detailed description below for a
+@@ -321,6 +321,7 @@ to the detailed description below for a
-K, --keep-dirlinks treat symlinked dir on receiver as dir
-H, --hard-links preserve hard links
-p, --perms preserve permissions
-E, --executability preserve executability
--chmod=CHMOD affect file and/or directory permissions
-o, --owner preserve owner (super-user only)
-@@ -501,7 +502,9 @@ specified, in which case bf(-r) is not i
+@@ -509,7 +510,9 @@ specified, in which case bf(-r) is not i
Note that bf(-a) bf(does not preserve hardlinks), because
finding multiply-linked files is expensive. You must separately
dit(--no-OPTION) You may turn off one or more implied options by prefixing
the option name with "no-". Not all options may be prefixed with a "no-":
-@@ -796,6 +799,13 @@ quote(itemization(
+@@ -804,6 +807,13 @@ quote(itemization(
If bf(--perms) is enabled, this option is ignored.