From c968d24c188b24e71f897239af4eb3b0c24055fa Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Sat, 19 Feb 2005 09:35:49 +0000 Subject: [PATCH] Fixed failing hunks. --- backup-dir-dels.diff | 35 ++++++++++++++++------------------- fname-convert.diff | 38 +++++++++++++++++++------------------- link-by-hash.diff | 38 +++++++++++++++++++------------------- owner-group-mod.diff | 28 ++++++++++++++-------------- 4 files changed, 68 insertions(+), 71 deletions(-) diff --git a/backup-dir-dels.diff b/backup-dir-dels.diff index 22c551c..d88a1f2 100644 --- a/backup-dir-dels.diff +++ b/backup-dir-dels.diff @@ -105,8 +105,8 @@ Marc St-Onge + deleting = 0; + return ret; +} ---- orig/flist.c 2005-02-14 02:45:10 -+++ flist.c 2005-01-30 10:11:42 +--- orig/flist.c 2005-02-19 09:27:48 ++++ flist.c 2005-02-19 09:29:36 @@ -46,6 +46,8 @@ extern char curr_dir[MAXPATHLEN]; extern unsigned int curr_dir_len; extern char *backup_dir; @@ -124,7 +124,7 @@ Marc St-Onge extern int copy_links; extern int copy_unsafe_links; extern int protocol_version; -@@ -1750,10 +1753,14 @@ char *f_name(struct file_struct *f) +@@ -1751,10 +1754,14 @@ char *f_name(struct file_struct *f) } @@ -140,7 +140,7 @@ Marc St-Onge } struct file_list *get_dirlist(const char *dirname, int ignore_filter_rules) -@@ -1859,11 +1866,12 @@ void delete_missing(struct file_list *fu +@@ -1860,9 +1867,10 @@ void delete_missing(struct file_list *fu mode = dir_list->files[i]->mode; if (flist_find(full_list, dir_list->files[i]) < 0) { char *f = f_name(dir_list->files[i]); @@ -150,13 +150,10 @@ Marc St-Onge && !S_ISDIR(mode)) { - make_backup(f); + safe_delete(f); - if (verbose) { -- rprintf(FINFO, "deleting %s\n", -+ rprintf(FINFO, "safe-deleting %s\n", - safe_fname(f)); - } + if (verbose || log_format) + log_delete(f, mode); } else if (S_ISDIR(mode)) ---- orig/options.c 2005-02-16 15:35:53 +--- orig/options.c 2005-02-19 09:27:48 +++ options.c 2005-01-28 19:17:35 @@ -119,10 +119,14 @@ int no_detach = 0; int write_batch = 0; @@ -183,7 +180,7 @@ Marc St-Onge int rsync_port = 0; int compare_dest = 0; int copy_dest = 0; -@@ -261,6 +267,8 @@ void usage(enum logcode F) +@@ -262,6 +268,8 @@ void usage(enum logcode F) rprintf(F," -b, --backup make backups (see --suffix & --backup-dir)\n"); rprintf(F," --backup-dir=DIR make backups into hierarchy based in DIR\n"); rprintf(F," --suffix=SUFFIX set backup suffix (default %s w/o --backup-dir)\n",BACKUP_SUFFIX); @@ -192,7 +189,7 @@ Marc St-Onge rprintf(F," -u, --update skip files that are newer on the receiver\n"); rprintf(F," --inplace update destination files in-place (SEE MAN PAGE)\n"); rprintf(F," -d, --dirs transfer directories without recursing\n"); -@@ -355,6 +363,7 @@ static struct poptOption long_options[] +@@ -356,6 +364,7 @@ static struct poptOption long_options[] /* longName, shortName, argInfo, argPtr, value, descrip, argDesc */ {"version", 0, POPT_ARG_NONE, 0, OPT_VERSION, 0, 0}, {"suffix", 0, POPT_ARG_STRING, &backup_suffix, 0, 0, 0 }, @@ -200,7 +197,7 @@ Marc St-Onge {"rsync-path", 0, POPT_ARG_STRING, &rsync_path, 0, 0, 0 }, {"password-file", 0, POPT_ARG_STRING, &password_file, 0, 0, 0 }, {"ignore-times", 'I', POPT_ARG_NONE, &ignore_times, 0, 0, 0 }, -@@ -434,6 +443,7 @@ static struct poptOption long_options[] +@@ -435,6 +444,7 @@ static struct poptOption long_options[] {"itemize-changes", 'i', POPT_ARG_NONE, &itemize_changes, 0, 0, 0 }, {"bwlimit", 0, POPT_ARG_INT, &bwlimit, 0, 0, 0 }, {"backup-dir", 0, POPT_ARG_STRING, &backup_dir, 0, 0, 0 }, @@ -208,7 +205,7 @@ Marc St-Onge {"hard-links", 'H', POPT_ARG_NONE, &preserve_hard_links, 0, 0, 0 }, {"read-batch", 0, POPT_ARG_STRING, &batch_name, OPT_READ_BATCH, 0, 0 }, {"write-batch", 0, POPT_ARG_STRING, &batch_name, OPT_WRITE_BATCH, 0, 0 }, -@@ -982,6 +992,8 @@ int parse_arguments(int *argc, const cha +@@ -980,6 +990,8 @@ int parse_arguments(int *argc, const cha partial_dir = sanitize_path(NULL, partial_dir, NULL, 0); if (backup_dir) backup_dir = sanitize_path(NULL, backup_dir, NULL, 0); @@ -217,7 +214,7 @@ Marc St-Onge if (files_from) files_from = sanitize_path(NULL, files_from, NULL, 0); } -@@ -1014,6 +1026,12 @@ int parse_arguments(int *argc, const cha +@@ -1012,6 +1024,12 @@ int parse_arguments(int *argc, const cha if (check_filter(elp, backup_dir, 1) < 0) goto options_rejected; } @@ -230,7 +227,7 @@ Marc St-Onge } if (server_filter_list.head && files_from) { if (!*files_from) -@@ -1036,6 +1054,16 @@ int parse_arguments(int *argc, const cha +@@ -1034,6 +1052,16 @@ int parse_arguments(int *argc, const cha backup_suffix); return 0; } @@ -247,7 +244,7 @@ Marc St-Onge if (backup_dir) { backup_dir_len = strlcpy(backup_dir_buf, backup_dir, sizeof backup_dir_buf); backup_dir_remainder = sizeof backup_dir_buf - backup_dir_len; -@@ -1057,6 +1085,31 @@ int parse_arguments(int *argc, const cha +@@ -1055,6 +1083,31 @@ int parse_arguments(int *argc, const cha "--suffix cannot be a null string without --backup-dir\n"); return 0; } @@ -279,7 +276,7 @@ Marc St-Onge if (log_format) { if (strstr(log_format, "%i") != NULL) -@@ -1305,6 +1358,10 @@ void server_options(char **args,int *arg +@@ -1318,6 +1371,10 @@ void server_options(char **args,int *arg args[ac++] = "--backup-dir"; args[ac++] = backup_dir; } @@ -290,7 +287,7 @@ Marc St-Onge /* Only send --suffix if it specifies a non-default value. */ if (strcmp(backup_suffix, backup_dir ? "" : BACKUP_SUFFIX) != 0) { -@@ -1313,7 +1370,13 @@ void server_options(char **args,int *arg +@@ -1326,7 +1383,13 @@ void server_options(char **args,int *arg goto oom; args[ac++] = arg; } diff --git a/fname-convert.diff b/fname-convert.diff index c89fe6c..cc9c0de 100644 --- a/fname-convert.diff +++ b/fname-convert.diff @@ -87,17 +87,17 @@ Note that you'll need to run 'make proto' after applying this patch. #define RERR_SIGNAL 20 /* status returned when sent SIGUSR1, SIGINT */ #define RERR_WAITCHILD 21 /* some error returned by waitpid() */ ---- orig/flist.c 2005-02-14 02:45:10 -+++ flist.c 2005-02-12 19:26:37 -@@ -67,6 +67,7 @@ extern int sanitize_paths; - extern int max_delete; +--- orig/flist.c 2005-02-19 09:27:48 ++++ flist.c 2005-02-19 09:31:41 +@@ -68,6 +68,7 @@ extern int max_delete; extern int orig_umask; extern int list_only; + extern char *log_format; +extern char *fname_convert_cmd; extern struct filter_list_struct filter_list; extern struct filter_list_struct server_filter_list; -@@ -345,7 +346,10 @@ void send_file_entry(struct file_struct +@@ -346,7 +347,10 @@ void send_file_entry(struct file_struct io_write_phase = "send_file_entry"; @@ -109,7 +109,7 @@ Note that you'll need to run 'make proto' after applying this patch. flags = base_flags; -@@ -561,6 +565,9 @@ static struct file_struct *receive_file_ +@@ -562,6 +566,9 @@ static struct file_struct *receive_file_ strlcpy(lastname, thisname, MAXPATHLEN); @@ -119,7 +119,7 @@ Note that you'll need to run 'make proto' after applying this patch. clean_fname(thisname, 0); if (sanitize_paths) -@@ -1074,6 +1081,9 @@ struct file_list *send_file_list(int f, +@@ -1075,6 +1082,9 @@ struct file_list *send_file_list(int f, start_write = stats.total_written; gettimeofday(&start_tv, NULL); @@ -129,7 +129,7 @@ Note that you'll need to run 'make proto' after applying this patch. flist = flist_new(WITH_HLINK, "send_file_list"); io_start_buffering_out(); -@@ -1256,6 +1266,9 @@ struct file_list *send_file_list(int f, +@@ -1257,6 +1267,9 @@ struct file_list *send_file_list(int f, stats.flist_size = stats.total_written - start_write; stats.num_files = flist->count; @@ -139,7 +139,7 @@ Note that you'll need to run 'make proto' after applying this patch. if (verbose > 3) output_flist(flist, who_am_i()); -@@ -1277,6 +1290,9 @@ struct file_list *recv_file_list(int f) +@@ -1278,6 +1291,9 @@ struct file_list *recv_file_list(int f) start_read = stats.total_read; @@ -149,7 +149,7 @@ Note that you'll need to run 'make proto' after applying this patch. flist = flist_new(WITH_HLINK, "recv_file_list"); received_flist = flist; -@@ -1330,6 +1346,9 @@ struct file_list *recv_file_list(int f) +@@ -1331,6 +1347,9 @@ struct file_list *recv_file_list(int f) io_error |= read_int(f); } @@ -382,9 +382,9 @@ Note that you'll need to run 'make proto' after applying this patch. + if (verbose > 2) + rprintf(FINFO, "Converted filename: %s -> %s\n", src, dest); +} ---- orig/generator.c 2005-02-14 02:45:10 +--- orig/generator.c 2005-02-19 09:27:48 +++ generator.c 2005-02-03 02:07:33 -@@ -289,7 +289,13 @@ static int find_fuzzy(struct file_struct +@@ -331,7 +331,13 @@ static int find_fuzzy(struct file_struct * start sending checksums. * * Note that f_out is set to -1 when doing final directory-permission and @@ -399,9 +399,9 @@ Note that you'll need to run 'make proto' after applying this patch. static void recv_generator(char *fname, struct file_list *flist, struct file_struct *file, int ndx, int f_out, int f_out_name) ---- orig/log.c 2005-02-07 20:41:56 +--- orig/log.c 2005-02-19 09:27:48 +++ log.c 2004-07-03 20:18:02 -@@ -57,6 +57,7 @@ struct { +@@ -60,6 +60,7 @@ struct { { RERR_STREAMIO , "error in rsync protocol data stream" }, { RERR_MESSAGEIO , "errors with program diagnostics" }, { RERR_IPC , "error in IPC code" }, @@ -409,7 +409,7 @@ Note that you'll need to run 'make proto' after applying this patch. { RERR_SIGNAL , "received SIGUSR1 or SIGINT" }, { RERR_WAITCHILD , "some error returned by waitpid()" }, { RERR_MALLOC , "error allocating core memory buffers" }, ---- orig/main.c 2005-02-14 02:45:10 +--- orig/main.c 2005-02-16 17:08:13 +++ main.c 2004-07-22 00:31:47 @@ -359,7 +359,7 @@ static pid_t do_cmd(char *cmd, char *mac whole_file = 1; @@ -420,7 +420,7 @@ Note that you'll need to run 'make proto' after applying this patch. if (dir) free(dir); ---- orig/options.c 2005-02-14 02:45:10 +--- orig/options.c 2005-02-19 09:27:48 +++ options.c 2005-02-14 02:50:32 @@ -129,6 +129,7 @@ char *basis_dir[MAX_BASIS_DIRS+1]; char *config_file = NULL; @@ -430,7 +430,7 @@ Note that you'll need to run 'make proto' after applying this patch. char *password_file = NULL; char *rsync_path = RSYNC_PATH; char *backup_dir = NULL; -@@ -307,6 +308,7 @@ void usage(enum logcode F) +@@ -310,6 +311,7 @@ void usage(enum logcode F) rprintf(F," --compare-dest=DIR also compare destination files relative to DIR\n"); rprintf(F," --copy-dest=DIR ... and include copies of unchanged files\n"); rprintf(F," --link-dest=DIR hardlink to files in DIR when unchanged\n"); @@ -438,7 +438,7 @@ Note that you'll need to run 'make proto' after applying this patch. rprintf(F," -z, --compress compress file data during the transfer\n"); rprintf(F," -C, --cvs-exclude auto-ignore files the same way CVS does\n"); rprintf(F," -f, --filter=RULE add a file-filtering RULE\n"); -@@ -414,6 +416,7 @@ static struct poptOption long_options[] +@@ -418,6 +420,7 @@ static struct poptOption long_options[] {"copy-dest", 0, POPT_ARG_STRING, 0, OPT_COPY_DEST, 0, 0 }, {"link-dest", 0, POPT_ARG_STRING, 0, OPT_LINK_DEST, 0, 0 }, {"fuzzy", 'y', POPT_ARG_NONE, &fuzzy_basis, 0, 0, 0 }, @@ -514,7 +514,7 @@ Note that you'll need to run 'make proto' after applying this patch. + + return result; +} ---- orig/util.c 2005-02-14 02:45:11 +--- orig/util.c 2005-02-18 20:17:35 +++ util.c 2004-07-03 20:18:02 @@ -1331,3 +1331,55 @@ uint32 fuzzy_distance(const char *s1, in diff --git a/link-by-hash.diff b/link-by-hash.diff index ccc0a0e..1f27c61 100644 --- a/link-by-hash.diff +++ b/link-by-hash.diff @@ -365,7 +365,7 @@ the file's name. +} + +#endif ---- orig/options.c 2005-02-16 15:35:53 +--- orig/options.c 2005-02-19 09:27:48 +++ options.c 2005-02-14 02:52:09 @@ -132,6 +132,7 @@ char *log_format = NULL; char *password_file = NULL; @@ -375,7 +375,7 @@ the file's name. char backup_dir_buf[MAXPATHLEN]; int rsync_port = 0; int compare_dest = 0; -@@ -309,6 +310,7 @@ void usage(enum logcode F) +@@ -310,6 +311,7 @@ void usage(enum logcode F) rprintf(F," --compare-dest=DIR also compare destination files relative to DIR\n"); rprintf(F," --copy-dest=DIR ... and include copies of unchanged files\n"); rprintf(F," --link-dest=DIR hardlink to files in DIR when unchanged\n"); @@ -383,7 +383,7 @@ the file's name. rprintf(F," -z, --compress compress file data during the transfer\n"); rprintf(F," -C, --cvs-exclude auto-ignore files the same way CVS does\n"); rprintf(F," -f, --filter=RULE add a file-filtering RULE\n"); -@@ -348,7 +350,7 @@ void usage(enum logcode F) +@@ -349,7 +351,7 @@ void usage(enum logcode F) enum {OPT_VERSION = 1000, OPT_DAEMON, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM, OPT_FILTER, OPT_COMPARE_DEST, OPT_COPY_DEST, OPT_LINK_DEST, OPT_INCLUDE, OPT_INCLUDE_FROM, OPT_MODIFY_WINDOW, @@ -392,7 +392,7 @@ the file's name. OPT_REFUSED_BASE = 9000}; static struct poptOption long_options[] = { -@@ -416,6 +418,7 @@ static struct poptOption long_options[] +@@ -417,6 +419,7 @@ static struct poptOption long_options[] {"compare-dest", 0, POPT_ARG_STRING, 0, OPT_COMPARE_DEST, 0, 0 }, {"copy-dest", 0, POPT_ARG_STRING, 0, OPT_COPY_DEST, 0, 0 }, {"link-dest", 0, POPT_ARG_STRING, 0, OPT_LINK_DEST, 0, 0 }, @@ -400,7 +400,7 @@ the file's name. {"fuzzy", 'y', POPT_ARG_NONE, &fuzzy_basis, 0, 0, 0 }, /* TODO: Should this take an optional int giving the compression level? */ {"compress", 'z', POPT_ARG_NONE, &do_compression, 0, 0, 0 }, -@@ -840,6 +843,21 @@ int parse_arguments(int *argc, const cha +@@ -838,6 +841,21 @@ int parse_arguments(int *argc, const cha basis_dir[basis_dir_cnt++] = (char *)arg; break; @@ -422,7 +422,7 @@ the file's name. default: /* A large opt value means that set_refuse_options() * turned this option off. */ -@@ -1392,6 +1410,11 @@ void server_options(char **args,int *arg +@@ -1405,6 +1423,11 @@ void server_options(char **args,int *arg } } @@ -434,7 +434,7 @@ the file's name. if (files_from && (!am_sender || remote_filesfrom_file)) { if (remote_filesfrom_file) { args[ac++] = "--files-from"; ---- orig/receiver.c 2005-02-16 15:35:53 +--- orig/receiver.c 2005-02-19 09:27:48 +++ receiver.c 2005-01-15 21:29:13 @@ -37,6 +37,7 @@ extern int preserve_hard_links; extern int preserve_perms; @@ -505,7 +505,7 @@ the file's name. } -@@ -555,8 +566,12 @@ int recv_files(int f_in, struct file_lis +@@ -558,8 +569,12 @@ int recv_files(int f_in, struct file_lis rprintf(FINFO, "%s\n", safe_fname(fname)); /* recv file data */ @@ -519,17 +519,17 @@ the file's name. if (!log_before_transfer) log_recv(file, &initial_stats, iflags); ---- orig/rsync.c 2005-02-14 02:45:10 -+++ rsync.c 2005-02-07 21:11:30 -@@ -36,6 +36,7 @@ extern int force_delete; - extern int recurse; - extern int keep_dirlinks; +--- orig/rsync.c 2005-02-19 09:27:48 ++++ rsync.c 2005-02-19 09:32:31 +@@ -40,6 +40,7 @@ extern int keep_dirlinks; extern int make_backups; -+extern char *link_by_hash_dir; + extern struct stats stats; extern char *backup_dir; - extern int inplace; ++extern char *link_by_hash_dir; + extern char *log_format; + -@@ -287,7 +288,12 @@ void finish_transfer(char *fname, char * +@@ -279,7 +280,12 @@ void finish_transfer(char *fname, char * rprintf(FINFO, "renaming %s to %s\n", safe_fname(fnametmp), safe_fname(fname)); } @@ -543,9 +543,9 @@ the file's name. if (ret < 0) { rsyserr(FERROR, errno, "%s %s -> \"%s\"", ret == -2 ? "copy" : "rename", ---- orig/rsync.h 2005-02-16 15:35:54 +--- orig/rsync.h 2005-02-19 09:27:49 +++ rsync.h 2004-07-03 20:20:15 -@@ -618,6 +618,14 @@ struct stats { +@@ -619,6 +619,14 @@ struct stats { int current_file_index; }; @@ -560,7 +560,7 @@ the file's name. #include "byteorder.h" #include "lib/mdfour.h" ---- orig/rsync.yo 2005-02-16 15:35:54 +--- orig/rsync.yo 2005-02-19 09:27:49 +++ rsync.yo 2005-02-13 06:58:47 @@ -355,6 +355,7 @@ to the detailed description below for a --compare-dest=DIR also compare received files relative to DIR diff --git a/owner-group-mod.diff b/owner-group-mod.diff index 44f9606..7fca7bf 100644 --- a/owner-group-mod.diff +++ b/owner-group-mod.diff @@ -5,12 +5,12 @@ groups, even if they weren't returned by getgroups(). E.g.: rsync -avoogg host:/from/ /to/ ---- orig/compat.c 2005-02-14 02:47:53 -+++ compat.c 2005-02-14 02:53:52 -@@ -28,11 +28,14 @@ - int remote_protocol = 0; +--- orig/compat.c 2005-02-19 09:27:48 ++++ compat.c 2005-02-19 09:33:44 +@@ -29,11 +29,14 @@ int remote_protocol = 0; extern int verbose; + extern int itemize_changes; +extern int am_root; extern int am_server; extern int am_sender; @@ -22,7 +22,7 @@ groups, even if they weren't returned by getgroups(). E.g.: extern int protocol_version; void setup_protocol(int f_out,int f_in) -@@ -89,4 +92,11 @@ void setup_protocol(int f_out,int f_in) +@@ -93,4 +96,11 @@ void setup_protocol(int f_out,int f_in) } else { checksum_seed = read_int(f_in); } @@ -34,9 +34,9 @@ groups, even if they weren't returned by getgroups(). E.g.: + preserve_gid = 2; + } } ---- orig/options.c 2005-02-15 19:27:05 +--- orig/options.c 2005-02-19 09:27:48 +++ options.c 2004-09-09 01:59:08 -@@ -391,8 +391,8 @@ static struct poptOption long_options[] +@@ -393,8 +393,8 @@ static struct poptOption long_options[] {"no-whole-file", 0, POPT_ARG_VAL, &whole_file, 0, 0, 0 }, {"copy-unsafe-links",0, POPT_ARG_NONE, ©_unsafe_links, 0, 0, 0 }, {"perms", 'p', POPT_ARG_NONE, &preserve_perms, 0, 0, 0 }, @@ -47,7 +47,7 @@ groups, even if they weren't returned by getgroups(). E.g.: {"devices", 'D', POPT_ARG_NONE, &preserve_devices, 0, 0, 0 }, {"times", 't', POPT_ARG_NONE, &preserve_times, 0, 0, 0 }, {"omit-dir-times", 'O', POPT_ARG_NONE, &omit_dir_times, 0, 0, 0 }, -@@ -722,6 +722,14 @@ int parse_arguments(int *argc, const cha +@@ -723,6 +723,14 @@ int parse_arguments(int *argc, const cha usage(FINFO); exit_cleanup(0); @@ -62,7 +62,7 @@ groups, even if they weren't returned by getgroups(). E.g.: case 'v': verbose++; break; -@@ -932,8 +940,8 @@ int parse_arguments(int *argc, const cha +@@ -933,8 +941,8 @@ int parse_arguments(int *argc, const cha #endif preserve_perms = 1; preserve_times = 1; @@ -73,7 +73,7 @@ groups, even if they weren't returned by getgroups(). E.g.: preserve_devices = 1; } -@@ -1211,10 +1219,16 @@ void server_options(char **args,int *arg +@@ -1233,10 +1241,16 @@ void server_options(char **args,int *arg argstr[x++] = 'i'; if (preserve_hard_links) argstr[x++] = 'H'; @@ -92,17 +92,17 @@ groups, even if they weren't returned by getgroups(). E.g.: if (preserve_devices) argstr[x++] = 'D'; if (preserve_times) ---- orig/rsync.c 2005-02-14 02:45:10 +--- orig/rsync.c 2005-02-19 09:27:48 +++ rsync.c 2005-02-01 10:46:04 -@@ -26,7 +26,6 @@ extern int verbose; - extern int dry_run; +@@ -27,7 +27,6 @@ extern int dry_run; + extern int itemize_changes; extern int preserve_times; extern int omit_dir_times; -extern int am_root; extern int am_server; extern int am_sender; extern int am_generator; -@@ -182,7 +181,7 @@ int set_perms(char *fname,struct file_st +@@ -174,7 +173,7 @@ int set_perms(char *fname,struct file_st updated = 1; } -- 2.34.1