extern int do_xfers;
extern int stdout_format_has_i;
extern int logfile_format_has_i;
-extern int receiver_symlink_times;
extern int am_root;
extern int am_server;
extern int am_daemon;
static int deldelay_fd = -1;
static int lull_mod;
static int dir_tweaking;
+static int symlink_timeset_failed_flags;
static int need_retouch_dir_times;
static int need_retouch_dir_perms;
static const char *solo_file = NULL;
int keep_time = !preserve_times ? 0
: S_ISDIR(file->mode) ? preserve_times > 1 :
#if defined HAVE_LUTIMES && defined HAVE_UTIMES
- (receiver_symlink_times && !(file->flags & FLAG_TIME_FAILED)) ||
-#endif
+ 1;
+#else
!S_ISLNK(file->mode);
+#endif
if (S_ISREG(file->mode) && F_LENGTH(file) != sxp->st.st_size)
iflags |= ITEM_REPORT_SIZE;
- if ((iflags & (ITEM_TRANSFER|ITEM_LOCAL_CHANGE) && !keep_time
- && !(iflags & ITEM_MATCHED)
+ if (file->flags & FLAG_TIME_FAILED) { /* symlinks only */
+ if (iflags & ITEM_LOCAL_CHANGE)
+ iflags |= symlink_timeset_failed_flags;
+ } else if (keep_time
+ ? cmp_time(file->modtime, sxp->st.st_mtime) != 0
+ : iflags & (ITEM_TRANSFER|ITEM_LOCAL_CHANGE) && !(iflags & ITEM_MATCHED)
&& (!(iflags & ITEM_XNAME_FOLLOWS) || *xname))
- || (keep_time && cmp_time(file->modtime, sxp->st.st_mtime) != 0))
iflags |= ITEM_REPORT_TIME;
#if !defined HAVE_LCHMOD && !defined HAVE_SETATTRLIST
if (S_ISLNK(file->mode)) {
if (itemizing && stdout_format_has_i
&& (verbose > 1 || stdout_format_has_i > 1)) {
int chg = compare_dest && type != TYPE_DIR ? 0
- : ITEM_LOCAL_CHANGE
- + (match_level == 3 ? ITEM_XNAME_FOLLOWS : 0);
+ : ITEM_LOCAL_CHANGE + (match_level == 3 ? ITEM_XNAME_FOLLOWS : 0);
char *lp = match_level == 3 ? "" : NULL;
itemize(cmpbuf, file, ndx, 0, sxp, chg + ITEM_MATCHED, 0, lp);
}
set_file_attrs(fname, file, NULL, NULL, 0);
if (itemizing) {
itemize(fname, file, ndx, statret, &sx,
- ITEM_LOCAL_CHANGE, 0, NULL);
+ ITEM_LOCAL_CHANGE|ITEM_REPORT_CHANGE, 0, NULL);
}
if (code != FNONE && verbose)
rprintf(code, "%s -> %s\n", fname, sl);
set_file_attrs(fname, file, NULL, NULL, 0);
if (itemizing) {
itemize(fname, file, ndx, statret, &sx,
- ITEM_LOCAL_CHANGE, 0, NULL);
+ ITEM_LOCAL_CHANGE|ITEM_REPORT_CHANGE, 0, NULL);
}
if (code != FNONE && verbose)
rprintf(code, "%s\n", fname);
if (itemizing) {
int iflags = ITEM_TRANSFER;
if (always_checksum > 0)
- iflags |= ITEM_REPORT_CHECKSUM;
+ iflags |= ITEM_REPORT_CHANGE;
if (fnamecmp_type != FNAMECMP_FNAME)
iflags |= ITEM_BASIS_TYPE_FOLLOWS;
if (fnamecmp_type == FNAMECMP_FUZZY)
dir_tweaking = !(list_only || solo_file || dry_run);
need_retouch_dir_times = preserve_times > 1;
lull_mod = allowed_lull * 5;
+ symlink_timeset_failed_flags = ITEM_REPORT_TIME
+ | (protocol_version >= 30 ? ITEM_REPORT_TIMEFAIL : 0 );
if (verbose > 2)
rprintf(FINFO, "generator starting pid=%ld\n", (long)getpid());
? iflags & ITEM_XNAME_FOLLOWS ? 'h' : 'c'
: !(iflags & ITEM_TRANSFER) ? '.'
: !local_server && *op == 's' ? '<' : '>';
- c[1] = S_ISDIR(file->mode) ? 'd'
- : IS_SPECIAL(file->mode) ? 'S'
- : IS_DEVICE(file->mode) ? 'D'
- : S_ISLNK(file->mode) ? 'L' : 'f';
- c[2] = !(iflags & ITEM_REPORT_CHECKSUM) ? '.' : 'c';
- c[3] = !(iflags & ITEM_REPORT_SIZE) ? '.' : 's';
- c[4] = !(iflags & ITEM_REPORT_TIME) ? '.'
- : !preserve_times || (!receiver_symlink_times && S_ISLNK(file->mode))
- ? 'T' : 't';
+ if (S_ISLNK(file->mode)) {
+ c[1] = 'L';
+ c[3] = '.';
+ c[4] = !(iflags & ITEM_REPORT_TIME) ? '.'
+ : !preserve_times || !receiver_symlink_times
+ || (iflags & ITEM_REPORT_TIMEFAIL) ? 'T' : 't';
+ } else {
+ c[1] = S_ISDIR(file->mode) ? 'd'
+ : IS_SPECIAL(file->mode) ? 'S'
+ : IS_DEVICE(file->mode) ? 'D' : 'f';
+ c[3] = !(iflags & ITEM_REPORT_SIZE) ? '.' : 's';
+ c[4] = !(iflags & ITEM_REPORT_TIME) ? '.'
+ : !preserve_times ? 'T' : 't';
+ }
+ c[2] = !(iflags & ITEM_REPORT_CHANGE) ? '.' : 'c';
c[5] = !(iflags & ITEM_REPORT_PERMS) ? '.' : 'p';
c[6] = !(iflags & ITEM_REPORT_OWNER) ? '.' : 'o';
c[7] = !(iflags & ITEM_REPORT_GROUP) ? '.' : 'g';
The attribute that is associated with each letter is as follows:
quote(itemization(
- it() A bf(c) means the checksum of the file is different and will be
- updated by the file transfer (requires bf(--checksum)).
+ it() A bf(c) means either that a regular file has a different checksum
+ (requires bf(--checksum)) or that a symlink, device, or special file has
+ a changed value.
it() A bf(s) means the size of the file is different and will be updated
by the file transfer.
it() A bf(t) means the modification time is different and is being updated
means that the modification time will be set to the transfer time, which happens
when a file/symlink/device is updated without bf(--times) and when a
symlink is changed and the receiver can't set its time.
+ (Note: when using an rsync 3.0.0 client, you might see the bf(s) flag combined
+ with bf(t) instead of the proper bf(T) flag for this time-setting failure.)
it() A bf(p) means the permissions are different and are being updated to
the sender's value (requires bf(--perms)).
it() An bf(o) means the owner is different and is being updated to the