Ticket #19591: patch-rsync306.diff

File patch-rsync306.diff, 29.4 KB (added by cssdev, 16 years ago)

patch to update version, checksums, and patches to rsync-3.0.6

  • files/patch-fileflags.diff

     
    6565diff --git a/configure.in b/configure.in
    6666--- a/configure.in
    6767+++ b/configure.in
    68 @@ -553,7 +553,7 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strdup chown chmod lchmod mknod mkfifo \
     68@@ -551,7 +551,7 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strdup chown chmod lchmod mknod mkfifo \
    6969     memmove lchown vsnprintf snprintf vasprintf asprintf setsid strpbrk \
    7070     strlcat strlcpy strtol mallinfo getgroups setgroups geteuid getegid \
    7171     setlocale setmode open64 lseek64 mkstemp64 mtrace va_copy __va_copy \
     
    108108+       }
    109109+#endif
    110110 
    111         if ((preserve_devices && IS_DEVICE(mode))
    112          || (preserve_specials && IS_SPECIAL(mode))) {
    113 @@ -538,6 +550,10 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
     111        if (preserve_devices && IS_DEVICE(mode)) {
     112                if (protocol_version < 28) {
     113@@ -548,6 +560,10 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
    114114        }
    115115        if (!(xflags & XMIT_SAME_MODE))
    116116                write_int(f, to_wire_mode(mode));
     
    121121        if (preserve_uid && !(xflags & XMIT_SAME_UID)) {
    122122                if (protocol_version < 30)
    123123                        write_int(f, uid);
    124 @@ -624,6 +640,9 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
     124@@ -634,6 +650,9 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
    125125 {
    126126        static int64 modtime;
    127127        static mode_t mode;
     
    131131 #ifdef SUPPORT_HARD_LINKS
    132132        static int64 dev;
    133133 #endif
    134 @@ -759,6 +778,10 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
     134@@ -768,6 +787,10 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
    135135 
    136136        if (chmod_modes && !S_ISLNK(mode))
    137137                mode = tweak_mode(mode, chmod_modes);
     
    142142 
    143143        if (preserve_uid && !(xflags & XMIT_SAME_UID)) {
    144144                if (protocol_version < 30)
    145 @@ -899,6 +922,10 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
     145@@ -909,6 +932,10 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
    146146        }
    147147 #endif
    148148        file->mode = mode;
     
    153153        if (preserve_uid)
    154154                F_OWNER(file) = uid;
    155155        if (preserve_gid) {
    156 @@ -1273,6 +1300,10 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
     156@@ -1283,6 +1310,10 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
    157157        }
    158158 #endif
    159159        file->mode = st.st_mode;
     
    164164        if (uid_ndx) /* Check uid_ndx instead of preserve_uid for del support */
    165165                F_OWNER(file) = st.st_uid;
    166166        if (gid_ndx) /* Check gid_ndx instead of preserve_gid for del support */
    167 @@ -1408,6 +1439,7 @@ static struct file_struct *send_file_name(int f, struct file_list *flist,
     167@@ -1426,6 +1457,7 @@ static struct file_struct *send_file_name(int f, struct file_list *flist,
    168168 #endif
    169169 #ifdef SUPPORT_XATTRS
    170170                if (preserve_xattrs) {
     
    286286 
    287287 #ifdef SUPPORT_HARD_LINKS
    288288        if (preserve_hard_links && F_HLINK_NOT_FIRST(file)
    289 @@ -2054,13 +2090,17 @@ static void touch_up_dirs(struct file_list *flist, int ndx)
     289@@ -2058,13 +2094,17 @@ static void touch_up_dirs(struct file_list *flist, int ndx)
    290290                        continue;
    291291                fname = f_name(file, NULL);
    292292                if (!(file->mode & S_IWUSR))
     
    416416   {"ignore-errors",    0,  POPT_ARG_VAL,    &ignore_errors, 1, 0, 0 },
    417417   {"no-ignore-errors", 0,  POPT_ARG_VAL,    &ignore_errors, 0, 0, 0 },
    418418   {"max-delete",       0,  POPT_ARG_INT,    &max_delete, 0, 0, 0 },
    419 @@ -1868,6 +1894,9 @@ void server_options(char **args, int *argc_p)
     419@@ -1874,6 +1900,9 @@ void server_options(char **args, int *argc_p)
    420420        if (xfer_dirs && !recurse && delete_mode && am_sender)
    421421                args[ac++] = "--no-r";
    422422 
     
    426426        if (do_compression && def_compress_level != Z_DEFAULT_COMPRESSION) {
    427427                if (asprintf(&arg, "--compress-level=%d", def_compress_level) < 0)
    428428                        goto oom;
    429 @@ -1955,6 +1984,16 @@ void server_options(char **args, int *argc_p)
     429@@ -1961,6 +1990,16 @@ void server_options(char **args, int *argc_p)
    430430                        args[ac++] = "--delete-excluded";
    431431                if (force_delete)
    432432                        args[ac++] = "--force";
     
    662662      --max-delete=NUM        don't delete more than NUM files
    663663      --max-size=SIZE         don't transfer any file larger than SIZE
    664664      --min-size=SIZE         don't transfer any file smaller than SIZE
    665 @@ -544,7 +548,8 @@ specified, in which case bf(-r) is not implied.
     665@@ -547,7 +551,8 @@ specified, in which case bf(-r) is not implied.
    666666 
    667667 Note that bf(-a) bf(does not preserve hardlinks), because
    668668 finding multiply-linked files is expensive.  You must separately
     
    672672 
    673673 dit(--no-OPTION) You may turn off one or more implied options by prefixing
    674674 the option name with "no-".  Not all options may be prefixed with a "no-":
    675 @@ -802,7 +807,7 @@ they would be using bf(--copy-links).
     675@@ -809,7 +814,7 @@ they would be using bf(--copy-links).
    676676 Without this option, if the sending side has replaced a directory with a
    677677 symlink to a directory, the receiving side will delete anything that is in
    678678 the way of the new symlink, including a directory hierarchy (as long as
     
    681681 
    682682 See also bf(--keep-dirlinks) for an analogous option for the receiving
    683683 side.
    684 @@ -939,6 +944,29 @@ super-user copies all namespaces except system.*.  A normal user only copies
     684@@ -946,6 +951,29 @@ super-user copies all namespaces except system.*.  A normal user only copies
    685685 the user.* namespace.  To be able to backup and restore non-user namespaces as
    686686 a normal user, see the bf(--fake-super) option.
    687687 
     
    711711 dit(bf(--chmod)) This option tells rsync to apply one or more
    712712 comma-separated "chmod" strings to the permission of the files in the
    713713 transfer.  The resulting value is treated as though it was the permissions
    714 @@ -1201,12 +1229,13 @@ See bf(--delete) (which is implied) for more details on file-deletion.
     714@@ -1216,12 +1244,13 @@ See bf(--delete) (which is implied) for more details on file-deletion.
    715715 dit(bf(--ignore-errors)) Tells bf(--delete) to go ahead and delete files
    716716 even when there are I/O errors.
    717717 
     
    728728 bf(--recursive) option was also enabled.
    729729 
    730730 dit(bf(--max-delete=NUM)) This tells rsync not to delete more than NUM
    731 @@ -1667,7 +1696,7 @@ with older versions of rsync, but that also turns on the output of other
     731@@ -1686,7 +1715,7 @@ with older versions of rsync, but that also turns on the output of other
    732732 verbose messages).
    733733 
    734734 The "%i" escape has a cryptic output that is 11 letters long.  The general
     
    737737 type of update being done, bf(X) is replaced by the file-type, and the
    738738 other letters represent attributes that may be output if they are being
    739739 modified.
    740 @@ -1723,7 +1752,7 @@ quote(itemization(
     740@@ -1742,7 +1771,7 @@ quote(itemization(
    741741   sender's value (requires bf(--owner) and super-user privileges).
    742742   it() A bf(g) means the group is different and is being updated to the
    743743   sender's value (requires bf(--group) and the authority to set the group).
     
    10491049diff --git a/xattrs.c b/xattrs.c
    10501050--- a/xattrs.c
    10511051+++ b/xattrs.c
    1052 @@ -281,6 +281,10 @@ int get_xattr(const char *fname, stat_x *sxp)
     1052@@ -283,6 +283,10 @@ int get_xattr(const char *fname, stat_x *sxp)
    10531053 {
    10541054        sxp->xattr = new(item_list);
    10551055        *sxp->xattr = empty_xattr;
     
    10601060        if (rsync_xal_get(fname, sxp->xattr) < 0) {
    10611061                free_xattr(sxp);
    10621062                return -1;
    1063 @@ -864,6 +868,11 @@ int set_xattr(const char *fname, const struct file_struct *file,
     1063@@ -883,6 +887,11 @@ int set_xattr(const char *fname, const struct file_struct *file,
    10641064                return -1;
    10651065        }
    10661066 
     
    10721072        ndx = F_XATTR(file);
    10731073        return rsync_xal_set(fname, lst + ndx, fnamecmp, sxp);
    10741074 }
    1075 @@ -980,7 +989,7 @@ int set_stat_xattr(const char *fname, struct file_struct *file, mode_t new_mode)
     1075@@ -999,7 +1008,7 @@ int set_stat_xattr(const char *fname, struct file_struct *file, mode_t new_mode)
    10761076        mode = (fst.st_mode & _S_IFMT) | (fmode & ACCESSPERMS)
    10771077             | (S_ISDIR(fst.st_mode) ? 0700 : 0600);
    10781078        if (fst.st_mode != mode)
    10791079-               do_chmod(fname, mode);
    10801080+               do_chmod(fname, mode, ST_FLAGS(fst));
    1081         if (!IS_DEVICE(fst.st_mode) && !IS_SPECIAL(fst.st_mode))
     1081        if (!IS_DEVICE(fst.st_mode))
    10821082                fst.st_rdev = 0; /* just in case */
    10831083 
     1084diff -up a/config.h.in b/config.h.in
     1085--- a/config.h.in
     1086+++ b/config.h.in
     1087@@ -70,6 +70,9 @@
     1088 /* Define to 1 if vsprintf has a C99-compatible return value */
     1089 #undef HAVE_C99_VSNPRINTF
     1090 
     1091+/* Define to 1 if you have the `chflags' function. */
     1092+#undef HAVE_CHFLAGS
     1093+
     1094 /* Define to 1 if you have the `chmod' function. */
     1095 #undef HAVE_CHMOD
     1096 
     1097diff -up a/configure.sh b/configure.sh
     1098--- a/configure.sh
     1099+++ b/configure.sh
     1100@@ -15031,12 +15031,13 @@ fi
     1101 
     1102 
     1103 
     1104+
     1105 for ac_func in waitpid wait4 getcwd strdup chown chmod lchmod mknod mkfifo \
     1106     fchmod fstat ftruncate strchr readlink link utime utimes lutimes strftime \
     1107     memmove lchown vsnprintf snprintf vasprintf asprintf setsid strpbrk \
     1108     strlcat strlcpy strtol mallinfo getgroups setgroups geteuid getegid \
     1109     setlocale setmode open64 lseek64 mkstemp64 mtrace va_copy __va_copy \
     1110-    strerror putenv iconv_open locale_charset nl_langinfo getxattr \
     1111+    chflags strerror putenv iconv_open locale_charset nl_langinfo getxattr \
     1112     extattr_get_link sigaction sigprocmask setattrlist
     1113 do
     1114 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
     1115diff -up a/proto.h b/proto.h
     1116--- a/proto.h
     1117+++ b/proto.h
     1118@@ -274,6 +274,8 @@ int read_ndx_and_attrs(int f_in, int *if
     1119 void free_sums(struct sum_struct *s);
     1120 mode_t dest_mode(mode_t flist_mode, mode_t stat_mode, int dflt_perms,
     1121                 int exists);
     1122+int make_mutable(const char *fname, mode_t mode, uint32 fileflags, uint32 iflags);
     1123+int undo_make_mutable(const char *fname, uint32 fileflags);
     1124 int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
     1125                   const char *fnamecmp, int flags);
     1126 RETSIGTYPE sig_int(UNUSED(int val));
     1127@@ -298,11 +300,12 @@ int sock_exec(const char *prog);
     1128 int do_unlink(const char *fname);
     1129 int do_symlink(const char *fname1, const char *fname2);
     1130 int do_link(const char *fname1, const char *fname2);
     1131-int do_lchown(const char *path, uid_t owner, gid_t group);
     1132+int do_lchown(const char *path, uid_t owner, gid_t group, mode_t mode, uint32 fileflags);
     1133 int do_mknod(const char *pathname, mode_t mode, dev_t dev);
     1134 int do_rmdir(const char *pathname);
     1135 int do_open(const char *pathname, int flags, mode_t mode);
     1136-int do_chmod(const char *path, mode_t mode);
     1137+int do_chmod(const char *path, mode_t mode, uint32 fileflags);
     1138+int do_chflags(const char *path, uint32 fileflags);
     1139 int do_rename(const char *fname1, const char *fname2);
     1140 void trim_trailing_slashes(char *name);
     1141 int do_mkdir(char *fname, mode_t mode);
     1142@@ -330,7 +333,7 @@ int fd_pair(int fd[2]);
     1143 void print_child_argv(const char *prefix, char **cmd);
     1144 NORETURN void out_of_memory(const char *str);
     1145 NORETURN void overflow_exit(const char *str);
     1146-int set_modtime(const char *fname, time_t modtime, mode_t mode);
     1147+int set_modtime(const char *fname, time_t modtime, mode_t mode, uint32 fileflags);
     1148 int mkdir_defmode(char *fname);
     1149 int create_directory_path(char *fname);
     1150 int full_write(int desc, const char *ptr, size_t len);
     1151diff -up a/rsync.1 b/rsync.1
     1152--- a/rsync.1
     1153+++ b/rsync.1
     1154@@ -417,6 +417,7 @@ to the detailed description below for a
     1155  \-K, \-\-keep\-dirlinks         treat symlinked dir on receiver as dir
     1156  \-H, \-\-hard\-links            preserve hard links
     1157  \-p, \-\-perms                 preserve permissions
     1158+     \-\-fileflags             preserve file-flags (aka chflags)
     1159  \-E, \-\-executability         preserve executability
     1160      \-\-chmod=CHMOD           affect file and/or directory permissions
     1161  \-A, \-\-acls                  preserve ACLs (implies \-p)
     1162@@ -448,7 +449,10 @@ to the detailed description below for a
     1163      \-\-delete\-after          receiver deletes after transfer, not before
     1164      \-\-delete\-excluded       also delete excluded files from dest dirs
     1165      \-\-ignore\-errors         delete even if there are I/O errors
     1166-     \-\-force                 force deletion of dirs even if not empty
     1167+     \-\-force\-delete          force deletion of dirs even if not empty
     1168+     \-\-force\-change          affect user/system immutable files/dirs
     1169+     \-\-force\-uchange         affect user-immutable files/dirs
     1170+     \-\-force\-schange         affect system-immutable files/dirs
     1171      \-\-max\-delete=NUM        don't delete more than NUM files
     1172      \-\-max\-size=SIZE         don't transfer any file larger than SIZE
     1173      \-\-min\-size=SIZE         don't transfer any file smaller than SIZE
     1174@@ -638,7 +642,8 @@ specified, in which case \fB\-r\fP is no
     1175 .IP
     1176 Note that \fB\-a\fP \fBdoes not preserve hardlinks\fP, because
     1177 finding multiply-linked files is expensive.  You must separately
     1178-specify \fB\-H\fP.
     1179+specify \fB\-H\fP.  Note also that for backward compatibility, \fB\-a\fP
     1180+currently does \fBnot\fP imply the \fB\-\-fileflags\fP option.
     1181 .IP
     1182 .IP "\-\-no\-OPTION"
     1183 You may turn off one or more implied options by prefixing
     1184@@ -931,7 +936,7 @@ they would be using \fB\-\-copy\-links\f
     1185 Without this option, if the sending side has replaced a directory with a
     1186 symlink to a directory, the receiving side will delete anything that is in
     1187 the way of the new symlink, including a directory hierarchy (as long as
     1188-\fB\-\-force\fP or \fB\-\-delete\fP is in effect).
     1189+\fB\-\-force\-delete\fP or \fB\-\-delete\fP is in effect).
     1190 .IP
     1191 See also \fB\-\-keep\-dirlinks\fP for an analogous option for the receiving
     1192 side.
     1193@@ -1086,6 +1091,33 @@ super-user copies all namespaces except
     1194 the user.* namespace.  To be able to backup and restore non-user namespaces as
     1195 a normal user, see the \fB\-\-fake\-super\fP option.
     1196 .IP
     1197+.IP "\fB\-\-fileflags\fP"
     1198+This option causes rsync to update the file-flags to be
     1199+the same as the source files and directories (if your OS supports the
     1200+\fBchflags\fP(2) system call).   Some flags can only be altered by the super-user
     1201+and some might only be unset below a certain secure-level (usually single-user
     1202+mode). It will not make files alterable that are set to immutable on the
     1203+receiver.  To do that, see \fB\-\-force\-change\fP, \fB\-\-force\-uchange\fP, and
     1204+\fB\-\-force\-schange\fP.
     1205+.IP
     1206+.IP "\fB\-\-force\-change\fP"
     1207+This option causes rsync to disable both user-immutable
     1208+and system-immutable flags on files and directories that are being updated or
     1209+deleted on the receiving side.  This option overrides \fB\-\-force\-uchange\fP and
     1210+\fB\-\-force\-schange\fP.
     1211+.IP
     1212+.IP "\fB\-\-force\-uchange\fP"
     1213+This option causes rsync to disable user-immutable
     1214+flags on files and directories that are being updated or deleted on the
     1215+receiving side.  It does not try to affect system flags.  This option overrides
     1216+\fB\-\-force\-change\fP and \fB\-\-force\-schange\fP.
     1217+.IP
     1218+.IP "\fB\-\-force\-schange\fP"
     1219+This option causes rsync to disable system-immutable
     1220+flags on files and directories that are being updated or deleted on the
     1221+receiving side.  It does not try to affect user flags.  This option overrides
     1222+\fB\-\-force\-change\fP and \fB\-\-force\-schange\fP.
     1223+.IP
     1224 .IP "\fB\-\-chmod\fP"
     1225 This option tells rsync to apply one or more
     1226 comma-separated \(lqchmod\(rq strings to the permission of the files in the
     1227@@ -1386,13 +1418,14 @@ See \fB\-\-delete\fP (which is implied)
     1228 Tells \fB\-\-delete\fP to go ahead and delete files
     1229 even when there are I/O errors.
     1230 .IP
     1231-.IP "\fB\-\-force\fP"
     1232+.IP "\fB\-\-force\-delete\fP"
     1233 This option tells rsync to delete a non-empty directory
     1234 when it is to be replaced by a non-directory.  This is only relevant if
     1235 deletions are not active (see \fB\-\-delete\fP for details).
     1236 .IP
     1237-Note for older rsync versions: \fB\-\-force\fP used to still be required when
     1238-using \fB\-\-delete\-after\fP, and it used to be non-functional unless the
     1239+This option can be abbreviated \fB\-\-force\fP for backward compatibility.
     1240+Note that some older rsync versions used to still require \fB\-\-force\fP
     1241+when using \fB\-\-delete\-after\fP, and it used to be non-functional unless the
     1242 \fB\-\-recursive\fP option was also enabled.
     1243 .IP
     1244 .IP "\fB\-\-max\-delete=NUM\fP"
     1245@@ -1928,7 +1961,7 @@ with older versions of rsync, but that a
     1246 verbose messages).
     1247 .IP
     1248 The \(lq%i\(rq escape has a cryptic output that is 11 letters long.  The general
     1249-format is like the string \fBYXcstpoguax\fP, where \fBY\fP is replaced by the
     1250+format is like the string \fBYXcstpogfax\fP, where \fBY\fP is replaced by the
     1251 type of update being done, \fBX\fP is replaced by the file-type, and the
     1252 other letters represent attributes that may be output if they are being
     1253 modified.
     1254@@ -1998,7 +2031,7 @@ sender's value (requires \fB\-\-owner\fP
     1255 A \fBg\fP means the group is different and is being updated to the
     1256 sender's value (requires \fB\-\-group\fP and the authority to set the group).
     1257 .IP o
     1258-The \fBu\fP slot is reserved for future use.
     1259+The \fBf\fP means that the fileflags information changed.
     1260 .IP o
     1261 The \fBa\fP means that the ACL information changed.
     1262 .IP o
  • files/patch-osx-xattr-nodev.diff

     
     1This patch makes the xattr functions skip devices and special files,
     2because OS X returns the wrong errno when getting/setting xattrs on
     3them (it returns EPERM instead of ENOTSUP).
     4
     5To use this patch, run these commands for a successful build:
     6
     7    patch -p1 <patches/osx-xattr-nodev.diff
     8    ./configure                         (optional if already run)
     9    make
     10
     11diff --git a/flist.c b/flist.c
     12--- a/flist.c
     13+++ b/flist.c
     14@@ -1426,6 +1426,7 @@ static struct file_struct *send_file_name(int f, struct file_list *flist,
     15 #endif
     16 #ifdef SUPPORT_XATTRS
     17                if (preserve_xattrs) {
     18+                       sx.st.st_mode = file->mode;
     19                        sx.xattr = NULL;
     20                        if (get_xattr(fname, &sx) < 0) {
     21                                io_error |= IOERR_GENERAL;
     22diff --git a/xattrs.c b/xattrs.c
     23--- a/xattrs.c
     24+++ b/xattrs.c
     25@@ -283,6 +283,10 @@ int get_xattr(const char *fname, stat_x *sxp)
     26 {
     27        sxp->xattr = new(item_list);
     28        *sxp->xattr = empty_xattr;
     29+
     30+       if (IS_SPECIAL(sxp->st.st_mode) || IS_DEVICE(sxp->st.st_mode))
     31+               return 0;
     32+
     33        if (rsync_xal_get(fname, sxp->xattr) < 0) {
     34                free_xattr(sxp);
     35                return -1;
     36@@ -883,6 +887,11 @@ int set_xattr(const char *fname, const struct file_struct *file,
     37                return -1;
     38        }
     39 
     40+       if (IS_SPECIAL(sxp->st.st_mode) || IS_DEVICE(sxp->st.st_mode)) {
     41+               errno = ENOTSUP;
     42+               return -1;
     43+       }
     44+
     45        ndx = F_XATTR(file);
     46        return rsync_xal_set(fname, lst + ndx, fnamecmp, sxp);
     47 }
  • files/patch-crtimes.diff

     
    5757        static mode_t mode;
    5858 #ifdef SUPPORT_FILEFLAGS
    5959        static uint32 fileflags;
    60 @@ -479,6 +480,13 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
     60@@ -489,6 +490,13 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
    6161                xflags |= XMIT_SAME_TIME;
    6262        else
    6363                modtime = file->modtime;
     
    7171 
    7272 #ifdef SUPPORT_HARD_LINKS
    7373        if (tmp_dev != 0) {
    74 @@ -548,6 +556,8 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
     74@@ -558,6 +566,8 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
    7575                else
    7676                        write_int(f, modtime);
    7777        }
     
    8080        if (!(xflags & XMIT_SAME_MODE))
    8181                write_int(f, to_wire_mode(mode));
    8282 #ifdef SUPPORT_FILEFLAGS
    83 @@ -638,7 +648,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
     83@@ -648,7 +658,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
    8484 static struct file_struct *recv_file_entry(struct file_list *flist,
    8585                                           int xflags, int f)
    8686 {
     
    8989        static mode_t mode;
    9090 #ifdef SUPPORT_FILEFLAGS
    9191        static uint32 fileflags;
    92 @@ -744,6 +754,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
     92@@ -754,6 +764,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
    9393                                uid = F_OWNER(first);
    9494                        if (preserve_gid)
    9595                                gid = F_GROUP(first);
    9696+                       if (crtimes_ndx)
    9797+                               crtime = f_crtime(first);
    98                         if ((preserve_devices && IS_DEVICE(mode))
    99                          || (preserve_specials && IS_SPECIAL(mode))) {
     98                        if (preserve_devices && IS_DEVICE(mode)) {
    10099                                uint32 *devp = F_RDEV_P(first);
    101 @@ -773,6 +785,19 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
     100                                rdev = MAKEDEV(DEV_MAJOR(devp), DEV_MINOR(devp));
     101@@ -782,6 +794,19 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
    102102                } else
    103103                        modtime = read_int(f);
    104104        }
     
    118118        if (!(xflags & XMIT_SAME_MODE))
    119119                mode = from_wire_mode(read_int(f));
    120120 
    121 @@ -932,6 +957,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
     121@@ -942,6 +967,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
    122122                F_GROUP(file) = gid;
    123123                file->flags |= gid_flags;
    124124        }
     
    127127        if (unsort_ndx)
    128128                F_NDX(file) = flist->used + flist->ndx_start;
    129129 
    130 @@ -1308,6 +1335,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
     130@@ -1318,6 +1345,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
    131131                F_OWNER(file) = st.st_uid;
    132132        if (gid_ndx) /* Check gid_ndx instead of preserve_gid for del support */
    133133                F_GROUP(file) = st.st_gid;
     
    182182 #if !defined HAVE_LCHMOD && !defined HAVE_SETATTRLIST
    183183                if (S_ISLNK(file->mode)) {
    184184                        ;
    185 @@ -1226,6 +1241,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx,
     185@@ -1225,7 +1240,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx,
     186 
    186187 static void list_file_entry(struct file_struct *f)
    187188 {
    188         char permbuf[PERMSTRING_SIZE];
    189 +       time_t crtime = crtimes_ndx ? f_crtime(f) : 0;
     189-       char permbuf[PERMSTRING_SIZE];
     190+       char permbuf[PERMSTRING_SIZE], crtime_buf[32];
    190191        double len;
    191192 
    192193        if (!F_IS_ACTIVE(f)) {
    193 @@ -1240,14 +1256,16 @@ static void list_file_entry(struct file_struct *f)
     194@@ -1236,19 +1251,24 @@ static void list_file_entry(struct file_struct *f)
     195        permstring(permbuf, f->mode);
     196        len = F_LENGTH(f);
    194197 
     198+       if (crtimes_ndx)
     199+               snprintf(crtime_buf, sizeof crtime_buf, " %s", timestring(f_crtime(f)));
     200+       else
     201+               *crtime_buf = '\0';
     202+
     203        /* TODO: indicate '+' if the entry has an ACL. */
     204 
    195205 #ifdef SUPPORT_LINKS
    196206        if (preserve_links && S_ISLNK(f->mode)) {
    197207-               rprintf(FINFO, "%s %11.0f %s %s -> %s\n",
    198 +               rprintf(FINFO, "%s %11.0f %s %s %s -> %s\n",
     208+               rprintf(FINFO, "%s %11.0f %s%s %s -> %s\n",
    199209                        permbuf, len, timestring(f->modtime),
    200 +                       crtimes_ndx ? timestring(crtime) : "",
    201                         f_name(f, NULL), F_SYMLINK(f));
     210-                       f_name(f, NULL), F_SYMLINK(f));
     211+                       crtime_buf, f_name(f, NULL), F_SYMLINK(f));
    202212        } else
    203213 #endif
    204214        {
    205215-               rprintf(FINFO, "%s %11.0f %s %s\n",
    206 +               rprintf(FINFO, "%s %11.0f %s %s %s\n",
     216+               rprintf(FINFO, "%s %11.0f %s%s %s\n",
    207217                        permbuf, len, timestring(f->modtime),
    208 +                       crtimes_ndx ? timestring(crtime) : "",
    209                         f_name(f, NULL));
     218-                       f_name(f, NULL));
     219+                       crtime_buf, f_name(f, NULL));
    210220        }
    211221 }
    212 @@ -1339,6 +1357,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
     222 
     223@@ -1339,6 +1359,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
    213224                        return;
    214225                }
    215226        }
     
    310321   {"omit-dir-times",  'O', POPT_ARG_VAL,    &omit_dir_times, 1, 0, 0 },
    311322   {"no-omit-dir-times",0,  POPT_ARG_VAL,    &omit_dir_times, 0, 0, 0 },
    312323   {"no-O",             0,  POPT_ARG_VAL,    &omit_dir_times, 0, 0, 0 },
    313 @@ -1800,6 +1805,8 @@ void server_options(char **args, int *argc_p)
     324@@ -1806,6 +1811,8 @@ void server_options(char **args, int *argc_p)
    314325                argstr[x++] = 'D';
    315326        if (preserve_times)
    316327                argstr[x++] = 't';
     
    426437      --super                 receiver attempts super-user activities
    427438      --fake-super            store/recover privileged attrs using xattrs
    428439  -S, --sparse                handle sparse files efficiently
    429 @@ -1032,6 +1033,9 @@ it is preserving modification times (see bf(--times)).  If NFS is sharing
     440@@ -1039,6 +1040,9 @@ it is preserving modification times (see bf(--times)).  If NFS is sharing
    430441 the directories on the receiving side, it is a good idea to use bf(-O).
    431442 This option is inferred if you use bf(--backup) without bf(--backup-dir).
    432443 
     
    436447 dit(bf(--super)) This tells the receiving side to attempt super-user
    437448 activities even if the receiving rsync wasn't run by the super-user.  These
    438449 activities include: preserving users via the bf(--owner) option, preserving
    439 @@ -1696,7 +1700,7 @@ with older versions of rsync, but that also turns on the output of other
     450@@ -1715,7 +1719,7 @@ with older versions of rsync, but that also turns on the output of other
    440451 verbose messages).
    441452 
    442453 The "%i" escape has a cryptic output that is 11 letters long.  The general
     
    445456 type of update being done, bf(X) is replaced by the file-type, and the
    446457 other letters represent attributes that may be output if they are being
    447458 modified.
    448 @@ -1755,6 +1759,8 @@ quote(itemization(
     459@@ -1774,6 +1778,8 @@ quote(itemization(
    449460   it() The bf(f) means that the fileflags information changed.
    450461   it() The bf(a) means that the ACL information changed.
    451462   it() The bf(x) means that the extended attribute information changed.
     
    649660   fprintf(F," -l, --link-times            display the time on a symlink\n");
    650661   fprintf(F," -L, --link-owner            display the owner+group on a symlink\n");
    651662 #ifdef SUPPORT_XATTRS
     663diff -up a/proto.h b/proto.h
     664--- a/proto.h
     665+++ b/proto.h
     666@@ -314,6 +314,8 @@ int do_stat(const char *fname, STRUCT_ST
     667 int do_lstat(const char *fname, STRUCT_STAT *st);
     668 int do_fstat(int fd, STRUCT_STAT *st);
     669 OFF_T do_lseek(int fd, OFF_T offset, int whence);
     670+time_t get_create_time(const char *path);
     671+int set_create_time(const char *path, time_t crtime);
     672 void set_compression(const char *fname);
     673 void send_token(int f, int32 token, struct map_struct *buf, OFF_T offset,
     674                int32 n, int32 toklen);
     675diff -up a/rsync.1 b/rsync.1
     676--- a/rsync.1
     677+++ b/rsync.1
     678@@ -429,6 +429,7 @@ to the detailed description below for a
     679  \-D                          same as \-\-devices \-\-specials
     680  \-t, \-\-times                 preserve modification times
     681  \-O, \-\-omit\-dir\-times        omit directories from \-\-times
     682+ \-N, \-\-crtimes               preserve create times (newness)
     683      \-\-super                 receiver attempts super-user activities
     684      \-\-fake\-super            store/recover privileged attrs using xattrs
     685  \-S, \-\-sparse                handle sparse files efficiently
     686@@ -1194,6 +1195,10 @@ it is preserving modification times (see
     687 the directories on the receiving side, it is a good idea to use \fB\-O\fP.
     688 This option is inferred if you use \fB\-\-backup\fP without \fB\-\-backup\-dir\fP.
     689 .IP
     690+.IP "\fB\-N, \-\-crtimes\fP"
     691+This tells rsync to set the create times (newness) of
     692+the destination files to the same value as the source files.
     693+.IP
     694 .IP "\fB\-\-super\fP"
     695 This tells the receiving side to attempt super-user
     696 activities even if the receiving rsync wasn't run by the super-user.  These
     697@@ -1961,7 +1966,7 @@ with older versions of rsync, but that a
     698 verbose messages).
     699 .IP
     700 The \(lq%i\(rq escape has a cryptic output that is 11 letters long.  The general
     701-format is like the string \fBYXcstpogfax\fP, where \fBY\fP is replaced by the
     702+format is like the string \fBYXcstpogfaxn\fP, where \fBY\fP is replaced by the
     703 type of update being done, \fBX\fP is replaced by the file-type, and the
     704 other letters represent attributes that may be output if they are being
     705 modified.
     706@@ -2036,6 +2041,9 @@ The \fBf\fP means that the fileflags inf
     707 The \fBa\fP means that the ACL information changed.
     708 .IP o
     709 The \fBx\fP means that the extended attribute information changed.
     710+.IP o
     711+A \fBn\fP means the create time (newness) is different and is being
     712+updated to the sender's value (requires \fB\-\-crtimes\fP).
     713 .RE
     714 
     715 .IP
  • Portfile

     
    33PortSystem          1.0
    44
    55name                rsync
    6 version             3.0.5
     6version             3.0.6
    77categories          net
    88platforms           darwin freebsd sunos
    99maintainers         simon openmaintainer
     
    1313                    under the GNU General Public License and is currently \
    1414                    being maintained by Wayne Davison. \
    1515                    \
    16                     Rsync version 3.0.5 has been released. This is a \
     16                    Rsync version 3.0.6 has been released. This is a \
    1717                    bug-fix release. Related pages: \
    1818                    http://rsync.samba.org/ftp/rsync/rsync-${version}-NEWS
    1919
     
    2121master_sites        http://rsync.samba.org/ftp/rsync/ \
    2222                    http://rsync.samba.org/ftp/rsync/src/
    2323checksums           ${distname}${extract.suffix} \
    24                         md5 a130e736c011572cb423b6245e97fc4b \
    25                         sha1 d95e75af9456b0edca68bde17260c98261b4b8c5 \
    26                         rmd160 c2a223c7afc29be413b593deaa2187f5d000f7a6
     24                        md5 e9865d093a18e4668b9d31b635dc8e99 \
     25                        sha1 8853dfd291b3850aafa60169d2eea8601498f713 \
     26                        rmd160 881ecea519b97d1a7f326b021ebac939ac2fe091
    2727distname            rsync-${version}
    2828
    2929depends_lib         port:popt port:libiconv