From 8aec0853fa3749d072b8e46ddefe5e38c719f76d Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Sat, 9 Dec 2006 02:05:16 +0000 Subject: [PATCH] Got rid of some patch fuzz. --- atimes.diff | 38 +++++++++++++++++++------------------- link-by-hash.diff | 8 ++++---- omit-dir-changes.diff | 10 +++++----- xattrs.diff | 20 ++++++++++---------- 4 files changed, 38 insertions(+), 38 deletions(-) diff --git a/atimes.diff b/atimes.diff index 264dcad..d3a624b 100644 --- a/atimes.diff +++ b/atimes.diff @@ -16,7 +16,7 @@ To use this patch, run these commands for a successful build: extern int relative_paths; extern int implied_dirs; extern int flist_extra_cnt; -@@ -134,6 +135,7 @@ void show_flist_stats(void) +@@ -137,6 +138,7 @@ void show_flist_stats(void) static void list_file_entry(struct file_struct *f) { char permbuf[PERMSTRING_SIZE]; @@ -24,7 +24,7 @@ To use this patch, run these commands for a successful build: double len; if (!F_IS_ACTIVE(f)) { -@@ -146,14 +148,16 @@ static void list_file_entry(struct file_ +@@ -149,14 +151,16 @@ static void list_file_entry(struct file_ #ifdef SUPPORT_LINKS if (preserve_links && S_ISLNK(f->mode)) { @@ -43,7 +43,7 @@ To use this patch, run these commands for a successful build: f_name(f, NULL)); } } -@@ -311,6 +315,7 @@ static void send_file_entry(struct file_ +@@ -314,6 +318,7 @@ static void send_file_entry(struct file_ { unsigned short flags; static time_t modtime; @@ -51,7 +51,7 @@ To use this patch, run these commands for a successful build: static mode_t mode; static int64 dev; static dev_t rdev; -@@ -326,7 +331,7 @@ static void send_file_entry(struct file_ +@@ -329,7 +334,7 @@ static void send_file_entry(struct file_ if (!file) { write_byte(f, 0); @@ -60,7 +60,7 @@ To use this patch, run these commands for a successful build: dev = 0, rdev = MAKEDEV(0, 0); rdev_major = 0; uid = 0, gid = 0; -@@ -376,6 +381,13 @@ static void send_file_entry(struct file_ +@@ -379,6 +384,13 @@ static void send_file_entry(struct file_ flags |= XMIT_SAME_TIME; else modtime = file->modtime; @@ -74,7 +74,7 @@ To use this patch, run these commands for a successful build: #ifdef SUPPORT_HARD_LINKS if (tmp_idev.dev != 0) { -@@ -428,6 +440,8 @@ static void send_file_entry(struct file_ +@@ -431,6 +443,8 @@ static void send_file_entry(struct file_ write_int(f, modtime); if (!(flags & XMIT_SAME_MODE)) write_int(f, to_wire_mode(mode)); @@ -83,7 +83,7 @@ To use this patch, run these commands for a successful build: if (preserve_uid && !(flags & XMIT_SAME_UID)) { if (!numeric_ids) add_uid(uid); -@@ -494,7 +508,7 @@ static void send_file_entry(struct file_ +@@ -497,7 +511,7 @@ static void send_file_entry(struct file_ static struct file_struct *recv_file_entry(struct file_list *flist, unsigned short flags, int f) { @@ -92,7 +92,7 @@ To use this patch, run these commands for a successful build: static mode_t mode; static int64 dev; static dev_t rdev; -@@ -514,7 +528,7 @@ static struct file_struct *recv_file_ent +@@ -517,7 +531,7 @@ static struct file_struct *recv_file_ent struct file_struct *file; if (!flist) { @@ -101,7 +101,7 @@ To use this patch, run these commands for a successful build: dev = 0, rdev = MAKEDEV(0, 0); rdev_major = 0; uid = 0, gid = 0; -@@ -570,6 +584,8 @@ static struct file_struct *recv_file_ent +@@ -573,6 +587,8 @@ static struct file_struct *recv_file_ent modtime = (time_t)read_int(f); if (!(flags & XMIT_SAME_MODE)) mode = from_wire_mode(read_int(f)); @@ -110,7 +110,7 @@ To use this patch, run these commands for a successful build: if (chmod_modes && !S_ISLNK(mode)) mode = tweak_mode(mode, chmod_modes); -@@ -654,6 +670,8 @@ static struct file_struct *recv_file_ent +@@ -657,6 +673,8 @@ static struct file_struct *recv_file_ent F_UID(file) = uid; if (preserve_gid) F_GID(file) = gid; @@ -119,7 +119,7 @@ To use this patch, run these commands for a successful build: if (dirname_len) { file->dirname = lastdir = bp; -@@ -931,6 +949,8 @@ struct file_struct *make_file(const char +@@ -934,6 +952,8 @@ struct file_struct *make_file(const char F_UID(file) = st.st_uid; if (preserve_gid) F_GID(file) = st.st_gid; @@ -138,7 +138,7 @@ To use this patch, run these commands for a successful build: extern int omit_dir_times; extern int delete_mode; extern int delete_before; -@@ -547,6 +548,9 @@ void itemize(struct file_struct *file, i +@@ -548,6 +549,9 @@ void itemize(struct file_struct *file, i && (!(iflags & ITEM_XNAME_FOLLOWS) || *xname)) || (keep_time && cmp_time(file->modtime, st->st_mtime) != 0)) iflags |= ITEM_REPORT_TIME; @@ -149,14 +149,14 @@ To use this patch, run these commands for a successful build: iflags |= ITEM_REPORT_PERMS; if (preserve_uid && am_root && F_UID(file) != st->st_uid) @@ -859,6 +863,8 @@ static int try_dests_reg(struct file_str - if (hard_link_one(file, ndx, fname, 0, stp, - cmpbuf, 1, i, code) < 0) + if (link_dest) { + if (!hard_link_one(file, fname, cmpbuf, 1)) goto try_a_copy; + if (preserve_atimes) + set_file_attrs(fname, file, stp, 0); if (preserve_hard_links && F_IS_HLINKED(file)) - hard_link_cluster(file, ndx, itemizing, code, j); - } else + finish_hard_link(file, fname, stp, itemizing, code, j); + if (itemizing && (verbose > 1 || stdout_format_has_i > 1)) { --- old/log.c +++ new/log.c @@ -37,6 +37,7 @@ extern int msg_fd_out; @@ -295,7 +295,7 @@ To use this patch, run these commands for a successful build: /* These flags are used in the live flist data. */ -@@ -121,6 +122,7 @@ +@@ -125,6 +126,7 @@ #define ATTRS_REPORT (1<<0) #define ATTRS_SKIP_MTIME (1<<1) @@ -303,7 +303,7 @@ To use this patch, run these commands for a successful build: #define FULL_FLUSH 1 #define NORMAL_FLUSH 0 -@@ -511,6 +513,7 @@ struct file_struct { +@@ -506,6 +508,7 @@ struct file_struct { union flist_extras { uid_t uid; /* The user ID number */ uid_t gid; /* The group ID number or GID_NONE */ @@ -311,7 +311,7 @@ To use this patch, run these commands for a successful build: struct idev *idev; /* The hard-link info during matching */ struct hlist *hlist; /* The hard-link info after matching */ int32 num; /* A signed number */ -@@ -553,6 +556,7 @@ extern int preserve_gid; +@@ -548,6 +551,7 @@ extern int preserve_gid; /* When the associated option is on, all entries will have these present: */ #define F_UID(f) REQ_EXTRA(f, preserve_uid)->uid #define F_GID(f) REQ_EXTRA(f, preserve_gid)->gid diff --git a/link-by-hash.diff b/link-by-hash.diff index 4f8cf50..a4a4675 100644 --- a/link-by-hash.diff +++ b/link-by-hash.diff @@ -31,9 +31,9 @@ To use this patch, run these commands for a successful build: extern struct stats stats; +extern char *link_by_hash_dir; extern struct file_list *the_file_list; + extern alloc_pool_t hlink_pool; - extern char curr_dir[MAXPATHLEN]; -@@ -621,7 +622,7 @@ static struct file_struct *recv_file_ent +@@ -624,7 +625,7 @@ static struct file_struct *recv_file_ent } #endif @@ -514,7 +514,7 @@ To use this patch, run these commands for a successful build: } static void handle_delayed_updates(struct file_list *flist, char *local_name) -@@ -609,7 +620,7 @@ int recv_files(int f_in, struct file_lis +@@ -604,7 +615,7 @@ int recv_files(int f_in, struct file_lis /* recv file data */ recv_ok = receive_data(f_in, fnamecmp, fd1, st.st_size, @@ -553,7 +553,7 @@ To use this patch, run these commands for a successful build: ret == -2 ? "copy" : "rename", --- old/rsync.h +++ new/rsync.h -@@ -692,6 +692,14 @@ struct stats { +@@ -685,6 +685,14 @@ struct stats { int current_file_index; }; diff --git a/omit-dir-changes.diff b/omit-dir-changes.diff index 38e2ef1..68a6cf3 100644 --- a/omit-dir-changes.diff +++ b/omit-dir-changes.diff @@ -17,9 +17,9 @@ To use this patch, run these commands for a successful build: extern int delete_mode; extern int delete_before; extern int delete_during; -@@ -479,10 +480,11 @@ void itemize(struct file_struct *file, i +@@ -550,10 +551,11 @@ void itemize(struct file_struct *file, i iflags |= ITEM_REPORT_TIME; - if ((file->mode & CHMOD_BITS) != (st->st_mode & CHMOD_BITS)) + if ((unsigned)(st->st_mode & CHMOD_BITS) != (file->mode & CHMOD_BITS)) iflags |= ITEM_REPORT_PERMS; - if (preserve_uid && am_root && F_UID(file) != st->st_uid) + if (preserve_uid && am_root && F_UID(file) != st->st_uid @@ -32,7 +32,7 @@ To use this patch, run these commands for a successful build: iflags |= ITEM_REPORT_GROUP; } else iflags |= ITEM_IS_NEW; -@@ -1088,7 +1090,7 @@ static void recv_generator(char *fname, +@@ -1169,7 +1171,7 @@ static void recv_generator(char *fname, /* If we're not preserving permissions, change the file-list's * mode based on the local permissions and some heuristics. */ @@ -95,8 +95,8 @@ To use this patch, run these commands for a successful build: +extern int omit_dir_changes; extern int basis_dir_cnt; extern int make_backups; - extern int flist_extra_ndx; -@@ -551,7 +552,7 @@ int recv_files(int f_in, struct file_lis + extern int cleanup_got_literal; +@@ -543,7 +544,7 @@ int recv_files(int f_in, struct file_lis /* If we're not preserving permissions, change the file-list's * mode based on the local permissions and some heuristics. */ diff --git a/xattrs.diff b/xattrs.diff index 8c9d532..e1d1a90 100644 --- a/xattrs.diff +++ b/xattrs.diff @@ -153,7 +153,7 @@ TODO: extern int preserve_links; extern int preserve_hard_links; extern int preserve_devices; -@@ -745,6 +746,10 @@ static struct file_struct *recv_file_ent +@@ -749,6 +750,10 @@ static struct file_struct *recv_file_ent if (preserve_acls) receive_acl(file, f); #endif @@ -164,7 +164,7 @@ TODO: return file; } -@@ -1006,7 +1011,7 @@ static struct file_struct *send_file_nam +@@ -1010,7 +1015,7 @@ static struct file_struct *send_file_nam unsigned short flags) { struct file_struct *file; @@ -173,7 +173,7 @@ TODO: statx sx; #endif -@@ -1026,6 +1031,13 @@ static struct file_struct *send_file_nam +@@ -1030,6 +1035,13 @@ static struct file_struct *send_file_nam return NULL; } #endif @@ -187,7 +187,7 @@ TODO: maybe_emit_filelist_progress(flist->count + flist_count_offset); -@@ -1036,6 +1048,10 @@ static struct file_struct *send_file_nam +@@ -1040,6 +1052,10 @@ static struct file_struct *send_file_nam if (preserve_acls && f >= 0) send_acl(&sx, f); #endif @@ -495,7 +495,7 @@ TODO: * will enable owner-writability using chmod, if necessary. --- old/rsync.h +++ new/rsync.h -@@ -504,6 +504,10 @@ struct idev { +@@ -508,6 +508,10 @@ struct idev { #define ACLS_NEED_MASK 1 #endif @@ -505,16 +505,16 @@ TODO: + #define GID_NONE ((gid_t)-1) - #define HL_CHECK_MASTER 0 -@@ -560,6 +564,7 @@ extern int preserve_gid; + struct file_struct { +@@ -557,6 +561,7 @@ extern int preserve_gid; #define F_UID(f) REQ_EXTRA(f, preserve_uid)->uid #define F_GID(f) REQ_EXTRA(f, preserve_gid)->gid #define F_ACL(f) REQ_EXTRA(f, preserve_acls)->unum +#define F_XATTR(f) REQ_EXTRA(f, preserve_xattrs)->unum - /* These are per-entry optional and mutally exclusive: */ - #define F_IDEV(f) OPT_EXTRA(f, LEN64_BUMP(f))->idev -@@ -734,6 +739,9 @@ typedef struct { + /* These items are per-entry optional and mutally exclusive: */ + #define F_HL_IDEV(f) OPT_EXTRA(f, LEN64_BUMP(f))->idev +@@ -732,6 +737,9 @@ typedef struct { struct rsync_acl *acc_acl; /* access ACL */ struct rsync_acl *def_acl; /* default ACL */ #endif -- 2.34.1