-After applying this patch, run these commands for a successful build:
+To use this patch, run these commands for a successful build:
+ patch -p1 <patches/atimes.diff
./prepare-source
./configure (optional if already run)
make
void *save_filters;
unsigned int len = strlen(fbuf);
if (len > 1 && fbuf[len-1] == '/')
-@@ -1589,8 +1614,9 @@ static void clean_flist(struct file_list
+@@ -1586,8 +1611,9 @@ static void clean_flist(struct file_list
}
/* Make sure we don't lose track of a user-specified
* top directory. */
clear_file(flist->files[drop], flist);
-@@ -1714,7 +1740,7 @@ static void output_flist(struct file_lis
+@@ -1711,7 +1737,7 @@ static void output_flist(struct file_lis
file->dirname ? file->dirname : "",
file->dirname ? "/" : "", NS(file->basename),
S_ISDIR(file->mode) ? "/" : "", (int)file->mode,
if (preserve_hard_links && file->link_u.links) {
if (dry_run)
file->link_u.links->link_dest_used = j + 1;
+@@ -930,7 +937,7 @@ static void recv_generator(char *fname,
+ rsyserr(FERROR, errno,
+ "recv_generator: mkdir %s failed",
+ full_fname(fname));
+- file->flags |= FLAG_MISSING;
++ FFLAGS(file) |= FLAG_MISSING;
+ if (ndx+1 < the_file_list->count
+ && the_file_list->files[ndx+1]->dir.depth > file->dir.depth) {
+ rprintf(FERROR,
@@ -944,7 +951,7 @@ static void recv_generator(char *fname,
&& verbose && code != FNONE && f_out != -1)
rprintf(code, "%s/\n", fname);
delete_in_dir(the_file_list, fname, file, &st);
return;
}
-@@ -1249,7 +1256,7 @@ static void recv_generator(char *fname,
+@@ -1252,7 +1259,7 @@ static void recv_generator(char *fname,
if (fuzzy_dirlist) {
int j = flist_find(fuzzy_dirlist, file);
if (j >= 0) /* don't use changing file as future fuzzy basis */
}
/* open the file */
+@@ -1517,7 +1524,7 @@ void generate_files(int f_out, struct fi
+ continue;
+ if (!need_retouch_dir_times && file->mode & S_IWUSR)
+ continue;
+- if (file->flags & FLAG_MISSING) {
++ if (FFLAGS(file) & FLAG_MISSING) {
+ int missing = file->dir.depth;
+ while (++i < flist->count) {
+ file = flist->files[i];
--- old/hlink.c
+++ new/hlink.c
@@ -30,6 +30,7 @@ extern int make_backups;
extern struct file_list *the_file_list;
#ifdef SUPPORT_HARD_LINKS
-@@ -90,10 +91,10 @@ static void link_idev_data(void)
+@@ -91,10 +92,10 @@ static void link_idev_data(void)
FPTR(cur)->link_u.links = pool_talloc(hlink_pool,
struct hlink, 1, "hlink_list");
FPTR(cur)->F_NEXT = head;
- FPTR(cur)->flags |= FLAG_HLINK_EOL;
+ FFLAGS(FPTR(cur)) |= FLAG_HLINK_EOL;
+ FPTR(cur)->link_u.links->link_dest_used = 0;
hlink_list[to++] = head;
} else
- FPTR(cur)->link_u.links = NULL;
-@@ -179,7 +180,7 @@ int hard_link_check(struct file_struct *
+@@ -181,7 +182,7 @@ int hard_link_check(struct file_struct *
{
#ifdef SUPPORT_HARD_LINKS
int head;
head = hlink_list[file->F_HLINDEX] = file->F_NEXT;
else
head = hlink_list[file->F_HLINDEX];
-@@ -287,8 +288,8 @@ void hard_link_cluster(struct file_struc
+@@ -289,8 +290,8 @@ void hard_link_cluster(struct file_struc
file->F_HLINDEX = FINISHED_LINK;
if (link_stat(f_name(file, hlink1), &st1, 0) < 0)
return;
ndx = file->F_NEXT;
file = FPTR(ndx);
}
-@@ -308,6 +309,6 @@ void hard_link_cluster(struct file_struc
+@@ -310,6 +311,6 @@ void hard_link_cluster(struct file_struc
send_msg(MSG_SUCCESS, numbuf, 4);
}
file->F_HLINDEX = FINISHED_LINK;
extern int protocol_version;
extern int preserve_times;
+extern int preserve_atimes;
- extern int in_exit_cleanup;
extern int stdout_format_has_i;
extern int stdout_format_has_o_or_i;
-@@ -615,7 +616,8 @@ static void log_formatted(enum logcode c
+ extern int logfile_format_has_i;
+@@ -606,7 +607,8 @@ static void log_formatted(enum logcode c
n[5] = !(iflags & ITEM_REPORT_PERMS) ? '.' : 'p';
n[6] = !(iflags & ITEM_REPORT_OWNER) ? '.' : 'o';
n[7] = !(iflags & ITEM_REPORT_GROUP) ? '.' : 'g';
int update_only = 0;
int cvs_exclude = 0;
int dry_run = 0;
-@@ -309,8 +310,9 @@ void usage(enum logcode F)
+@@ -311,8 +312,9 @@ void usage(enum logcode F)
rprintf(F," --devices preserve device files (super-user only)\n");
rprintf(F," --specials preserve special files\n");
rprintf(F," -D same as --devices --specials\n");
rprintf(F," --super receiver attempts super-user activities\n");
rprintf(F," -S, --sparse handle sparse files efficiently\n");
rprintf(F," -n, --dry-run show what would have been transferred\n");
-@@ -424,6 +426,9 @@ static struct poptOption long_options[]
+@@ -428,6 +430,9 @@ static struct poptOption long_options[]
{"times", 't', POPT_ARG_VAL, &preserve_times, 1, 0, 0 },
{"no-times", 0, POPT_ARG_VAL, &preserve_times, 0, 0, 0 },
{"no-t", 0, POPT_ARG_VAL, &preserve_times, 0, 0, 0 },
{"omit-dir-times", 'O', POPT_ARG_VAL, &omit_dir_times, 2, 0, 0 },
{"modify-window", 0, POPT_ARG_INT, &modify_window, OPT_MODIFY_WINDOW, 0, 0 },
{"super", 0, POPT_ARG_VAL, &am_root, 2, 0, 0 },
-@@ -1534,6 +1539,8 @@ void server_options(char **args,int *arg
+@@ -1538,6 +1543,8 @@ void server_options(char **args,int *arg
argstr[x++] = 'D';
if (preserve_times)
argstr[x++] = 't';
* by doubling until FLIST_LINEAR then grow by FLIST_LINEAR
--- old/rsync.yo
+++ new/rsync.yo
-@@ -327,8 +327,9 @@ to the detailed description below for a
+@@ -328,8 +328,9 @@ to the detailed description below for a
--devices preserve device files (super-user only)
--specials preserve special files
-D same as --devices --specials
--super receiver attempts super-user activities
-S, --sparse handle sparse files efficiently
-n, --dry-run show what would have been transferred
-@@ -861,6 +862,12 @@ it is preserving modification times (see
+@@ -869,6 +870,12 @@ 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(--super)) This tells the receiving side to attempt super-user
activities even if the receiving rsync wasn't run by the super-user. These
activities include: preserving users via the bf(--owner) option, preserving
-@@ -1382,7 +1389,7 @@ with older versions of rsync, but that a
+@@ -1390,7 +1397,7 @@ with older versions of rsync, but that a
verbose messages).
The "%i" escape has a cryptic output that is 9 letters long. The general
type of update being done, bf(X) is replaced by the file-type, and the
other letters represent attributes that may be output if they are being
modified.
-@@ -1422,7 +1429,7 @@ quote(itemization(
+@@ -1430,7 +1437,7 @@ quote(itemization(
by the file transfer.
it() A bf(t) means the modification time is different and is being updated
to the sender's value (requires bf(--times)). An alternate value of bf(T)
anytime a symlink is transferred, or when a file or device is transferred
without bf(--times).
it() A bf(p) means the permissions are different and are being updated to
-@@ -1431,7 +1438,10 @@ quote(itemization(
+@@ -1439,7 +1446,10 @@ quote(itemization(
sender's value (requires bf(--owner) and super-user privileges).
it() A bf(g) means the group is different and is being updated to the
sender's value (requires bf(--group) and the authority to set the group).
- fprintf(stderr, "usage: " PROGRAM " DIR ...\n"
- "Trivial file listing program for portably checking rsync\n");
- return 1;
+- }
+ poptContext pc;
+ const char **extra_args;
+ int opt;
-+
+
+- for (argv++; *argv; argv++) {
+- list_file(*argv);
+ pc = poptGetContext(PROGRAM, argc, (const char **)argv,
+ long_options, 0);
+ while ((opt = poptGetNextOpt(pc)) != -1) {
+ }
}
-- for (argv++; *argv; argv++) {
-- list_file(*argv);
-- }
+ extra_args = poptGetArgs(pc);
+ if (*extra_args == NULL)
+ tls_usage(1);
+ for (; *extra_args; extra_args++)
+ list_file(*extra_args);
+ poptFreeContext(pc);
-
++
return 0;
}
--- old/util.c