From d608ca236330630fd4dafeff2dd974fb20c67f3a Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Sat, 5 Mar 2005 00:32:53 +0000 Subject: [PATCH] Fixed failing hunks. --- ODBC-dblog.diff | 24 ++++++++++++------------ backup-dir-dels.diff | 17 +++++++++-------- copy-dest.diff | 22 +++++++++++----------- fname-convert.diff | 32 ++++++++++++++++---------------- source-cd.diff | 18 +++++++++--------- time-limit.diff | 24 ++++++++++++------------ 6 files changed, 69 insertions(+), 68 deletions(-) diff --git a/ODBC-dblog.diff b/ODBC-dblog.diff index 9449ee9..86f091d 100644 --- a/ODBC-dblog.diff +++ b/ODBC-dblog.diff @@ -137,7 +137,7 @@ This patch adds the following options: } else { rprintf(FLOG, "rsync %s %s from %s (%s)\n", am_sender ? "on" : "to", ---- orig/configure.in 2005-02-25 18:44:31 +--- orig/configure.in 2005-03-01 15:57:00 +++ configure.in 2004-07-03 20:22:18 @@ -94,6 +94,8 @@ AC_ARG_WITH(rsync-path, [ --with-rsync-path=PATH set default --rsync-path to PATH (default: rsync)], @@ -686,7 +686,7 @@ This patch adds the following options: FN_LOCAL_BOOL(lp_ignore_errors, ignore_errors) FN_LOCAL_BOOL(lp_ignore_nonreadable, ignore_nonreadable) FN_LOCAL_STRING(lp_uid, uid) ---- orig/log.c 2005-02-26 05:22:50 +--- orig/log.c 2005-03-05 00:25:25 +++ log.c 2004-07-03 20:22:18 @@ -81,7 +81,7 @@ struct { /* @@ -697,9 +697,9 @@ This patch adds the following options: { int i; for (i = 0; rerr_names[i].name; i++) { ---- orig/main.c 2005-03-01 03:39:47 +--- orig/main.c 2005-03-05 00:25:25 +++ main.c 2004-07-03 20:22:18 -@@ -138,6 +138,9 @@ static void report(int f) +@@ -139,6 +139,9 @@ static void report(int f) if (am_daemon) { log_exit(0, __FILE__, __LINE__); @@ -709,24 +709,24 @@ This patch adds the following options: if (f == -1 || !am_sender) return; } ---- orig/receiver.c 2005-02-26 19:27:54 -+++ receiver.c 2005-02-16 15:40:15 -@@ -607,6 +607,9 @@ int recv_files(int f_in, struct file_lis +--- orig/receiver.c 2005-03-05 00:25:25 ++++ receiver.c 2005-03-05 00:31:00 +@@ -568,6 +568,9 @@ int recv_files(int f_in, struct file_lis if (!log_before_transfer) - log_recv(file, &initial_stats, iflags); + log_item(file, &initial_stats, iflags, NULL); +#if HAVE_LIBODBC + db_log_transfer(file, &initial_stats, "receive"); +#endif if (fd1 != -1) close(fd1); ---- orig/sender.c 2005-02-26 03:22:59 -+++ sender.c 2005-02-16 15:40:44 -@@ -301,6 +301,9 @@ void send_files(struct file_list *flist, +--- orig/sender.c 2005-03-05 00:25:25 ++++ sender.c 2005-03-05 00:31:19 +@@ -323,6 +323,9 @@ void send_files(struct file_list *flist, match_sums(f_out, s, mbuf, st.st_size); if (!log_before_transfer) - log_send(file, &initial_stats, iflags); + log_item(file, &initial_stats, iflags, NULL); +#if HAVE_LIBODBC + db_log_transfer(file, &initial_stats,"send"); +#endif diff --git a/backup-dir-dels.diff b/backup-dir-dels.diff index fa1af3c..dd0b5b9 100644 --- a/backup-dir-dels.diff +++ b/backup-dir-dels.diff @@ -106,22 +106,23 @@ Marc St-Onge + deleting = 0; + return ret; +} ---- orig/generator.c 2005-02-27 18:24:42 -+++ generator.c 2005-02-26 19:31:06 -@@ -82,16 +82,23 @@ extern dev_t filesystem_dev; +--- orig/generator.c 2005-03-05 00:25:24 ++++ generator.c 2005-03-05 00:26:54 +@@ -83,6 +83,9 @@ extern dev_t filesystem_dev; extern char *backup_dir; extern char *backup_suffix; extern int backup_suffix_len; +extern char *backup_dir_dels; +extern char *backup_suffix_dels; +extern int backup_suffix_dels_len; - + extern struct file_list *the_file_list; extern struct filter_list_struct server_filter_list; +@@ -91,10 +94,14 @@ int allowed_lull = 0; static int deletion_count = 0; /* used to implement --max-delete */ -+/* Function now checks if file matches backup- or delete-suffix patterns. */ ++/* Function now compares both backup_suffix and backup_suffix_dels. */ static int is_backup_file(char *fn) { int k = strlen(fn) - backup_suffix_len; @@ -133,7 +134,7 @@ Marc St-Onge } -@@ -109,8 +116,8 @@ static int delete_item(char *fname, int +@@ -112,8 +119,8 @@ static int delete_item(char *fname, int return -1; if (!S_ISDIR(mode)) { @@ -144,7 +145,7 @@ Marc St-Onge else ok = robust_unlink(fname) == 0; if (ok) { -@@ -131,9 +138,9 @@ static int delete_item(char *fname, int +@@ -134,9 +141,9 @@ static int delete_item(char *fname, int if (dry_run && zap_dir) { ok = 0; errno = ENOTEMPTY; @@ -156,7 +157,7 @@ Marc St-Onge else ok = do_rmdir(fname) == 0; if (ok) { ---- orig/options.c 2005-03-01 05:49:24 +--- orig/options.c 2005-03-02 09:52:06 +++ options.c 2005-03-01 01:25:39 @@ -127,10 +127,14 @@ int no_detach int write_batch = 0; diff --git a/copy-dest.diff b/copy-dest.diff index 1d8d422..f529acd 100644 --- a/copy-dest.diff +++ b/copy-dest.diff @@ -2,9 +2,9 @@ This adds the option --copy-dest, which works just like --link-dest except that identical files are copied into the destination instead of hard-linked. ---- orig/generator.c 2005-03-03 02:05:54 -+++ generator.c 2005-03-03 00:25:59 -@@ -65,6 +65,7 @@ extern int always_checksum; +--- orig/generator.c 2005-03-05 00:25:24 ++++ generator.c 2005-03-05 00:27:49 +@@ -66,6 +66,7 @@ extern int always_checksum; extern char *partial_dir; extern char *basis_dir[]; extern int compare_dest; @@ -12,7 +12,7 @@ of hard-linked. extern int link_dest; extern int whole_file; extern int local_server; -@@ -837,6 +838,8 @@ static void recv_generator(char *fname, +@@ -860,6 +861,8 @@ static void recv_generator(char *fname, continue; best_match = i; match_level = 2; @@ -21,7 +21,7 @@ of hard-linked. /* FALL THROUGH */ case 2: if (!unchanged_attrs(file, &st)) -@@ -870,7 +873,20 @@ static void recv_generator(char *fname, +@@ -897,7 +900,20 @@ static void recv_generator(char *fname, match_level = 2; } #endif @@ -43,17 +43,17 @@ of hard-linked. fnamecmp = fnamecmpbuf; fnamecmp_type = i; } -@@ -935,11 +951,9 @@ static void recv_generator(char *fname, +@@ -964,11 +980,9 @@ static void recv_generator(char *fname, return; } /* Only --compare-dest gets here. */ - if (unchanged_attrs(file, &st)) { -- itemize(file, statret, &st, ITEM_NO_DEST_AND_NO_UPDATE, -- f_out, ndx); +- itemize(file, ndx, statret, &st, +- ITEM_NO_DEST_AND_NO_UPDATE, NULL); - return; - } -+ itemize(file, statret, &st, ITEM_NO_DEST_AND_NO_UPDATE, -+ f_out, ndx); ++ itemize(file, ndx, statret, &st, ++ ITEM_NO_DEST_AND_NO_UPDATE, NULL); + return; } @@ -117,7 +117,7 @@ of hard-linked. return 0; } ---- orig/rsync.yo 2005-03-03 02:23:27 +--- orig/rsync.yo 2005-03-04 16:13:54 +++ rsync.yo 2005-03-03 02:19:19 @@ -353,6 +353,7 @@ to the detailed description below for a -T, --temp-dir=DIR create temporary files in directory DIR diff --git a/fname-convert.diff b/fname-convert.diff index eac4927..aed07a7 100644 --- a/fname-convert.diff +++ b/fname-convert.diff @@ -87,15 +87,15 @@ 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-26 19:27:54 -+++ flist.c 2005-02-26 19:32:53 -@@ -59,6 +59,7 @@ extern int copy_unsafe_links; +--- orig/flist.c 2005-03-04 08:27:33 ++++ flist.c 2005-03-05 00:29:08 +@@ -57,6 +57,7 @@ extern int copy_unsafe_links; extern int protocol_version; extern int sanitize_paths; extern int orig_umask; +extern char *fname_convert_cmd; - - extern char curr_dir[MAXPATHLEN]; + extern struct stats stats; + extern struct file_list *the_file_list; @@ -338,7 +339,10 @@ void send_file_entry(struct file_struct @@ -147,9 +147,9 @@ Note that you'll need to run 'make proto' after applying this patch. + init_fname_convert(); + flist = flist_new(WITH_HLINK, "recv_file_list"); - received_flist = flist; -@@ -1327,6 +1343,9 @@ struct file_list *recv_file_list(int f) + flist->count = 0; +@@ -1326,6 +1342,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-27 18:24:42 -+++ generator.c 2005-02-03 02:07:33 -@@ -554,7 +554,13 @@ static int find_fuzzy(struct file_struct +--- orig/generator.c 2005-03-05 00:25:24 ++++ generator.c 2005-03-05 00:29:37 +@@ -572,7 +572,13 @@ void check_for_finished_hlinks(int itemi * start sending checksums. * * Note that f_out is set to -1 when doing final directory-permission and @@ -396,10 +396,10 @@ Note that you'll need to run 'make proto' after applying this patch. + * files are printf()ed here but regular files are rprintf()ed on the + * sender (unconverted). To solve the above, move all progress + * reporting to the sender. */ - static void recv_generator(char *fname, struct file_list *flist, - struct file_struct *file, int ndx, + static void recv_generator(char *fname, struct file_struct *file, int ndx, int itemizing, int maybe_PERMS_REPORT, ---- orig/log.c 2005-02-26 05:22:50 + enum logcode code, int f_out, int f_out_name) +--- orig/log.c 2005-03-05 00:25:25 +++ log.c 2004-07-03 20:18:02 @@ -63,6 +63,7 @@ struct { { RERR_STREAMIO , "error in rsync protocol data stream" }, @@ -409,9 +409,9 @@ 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-03-01 03:39:47 +--- orig/main.c 2005-03-05 00:25:25 +++ main.c 2004-07-22 00:31:47 -@@ -362,7 +362,7 @@ static pid_t do_cmd(char *cmd, char *mac +@@ -363,7 +363,7 @@ static pid_t do_cmd(char *cmd, char *mac whole_file = 1; ret = local_child(argc, args, f_in, f_out, child_main); } else @@ -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-03-01 05:49:24 +--- orig/options.c 2005-03-02 09:52:06 +++ options.c 2005-02-14 02:50:32 @@ -137,6 +137,7 @@ char *basis_dir[MAX_BASIS_DIRS+1]; char *config_file = NULL; diff --git a/source-cd.diff b/source-cd.diff index adef8e5..c2b0691 100644 --- a/source-cd.diff +++ b/source-cd.diff @@ -6,15 +6,15 @@ rsync -avR --source-cd=/usr local/bin host:/ For two systems where one uses /usr/local/bin and the other /local/bin. ---- orig/flist.c 2005-02-26 19:27:54 -+++ flist.c 2005-02-26 19:34:30 -@@ -59,6 +59,7 @@ extern int copy_unsafe_links; +--- orig/flist.c 2005-03-04 08:27:33 ++++ flist.c 2005-03-05 00:31:42 +@@ -57,6 +57,7 @@ extern int copy_unsafe_links; extern int protocol_version; extern int sanitize_paths; extern int orig_umask; +extern char *source_cd; - - extern char curr_dir[MAXPATHLEN]; + extern struct stats stats; + extern struct file_list *the_file_list; @@ -1075,13 +1076,14 @@ struct file_list *send_file_list(int f, @@ -36,7 +36,7 @@ For two systems where one uses /usr/local/bin and the other /local/bin. while (1) { char fname2[MAXPATHLEN]; ---- orig/options.c 2005-03-01 05:49:24 +--- orig/options.c 2005-03-02 09:52:06 +++ options.c 2005-03-01 01:37:22 @@ -81,6 +81,7 @@ char *filesfrom_host = NULL; int eol_nulls = 0; @@ -101,9 +101,9 @@ For two systems where one uses /usr/local/bin and the other /local/bin. if (ignore_errors) args[ac++] = "--ignore-errors"; ---- orig/rsync.yo 2005-03-01 01:22:59 +--- orig/rsync.yo 2005-03-04 16:13:54 +++ rsync.yo 2005-02-22 18:20:24 -@@ -304,6 +304,7 @@ to the detailed description below for a +@@ -303,6 +303,7 @@ to the detailed description below for a -R, --relative use relative path names --no-relative turn off --relative --no-implied-dirs don't send implied dirs with -R @@ -111,7 +111,7 @@ For two systems where one uses /usr/local/bin and the other /local/bin. -b, --backup make backups (see --suffix & --backup-dir) --backup-dir=DIR make backups into hierarchy based in DIR --suffix=SUFFIX backup suffix (default ~ w/o --backup-dir) -@@ -510,6 +511,11 @@ the bf(--no-implied-dirs) option would o +@@ -509,6 +510,11 @@ the bf(--no-implied-dirs) option would o which means that if "/path" was a real directory on one machine and a symlink of the other machine, rsync would not try to change this. diff --git a/time-limit.diff b/time-limit.diff index 427ba70..1a7dff3 100644 --- a/time-limit.diff +++ b/time-limit.diff @@ -3,17 +3,17 @@ to be simpler and more efficient by Wayne Davison. Do we need configure support for mktime()? ---- orig/io.c 2005-03-01 03:11:36 -+++ io.c 2005-03-01 03:12:23 -@@ -51,6 +51,7 @@ extern int eol_nulls; - extern int csum_length; - extern int checksum_seed; - extern int protocol_version; -+extern time_t stop_at_utime; +--- orig/io.c 2005-03-05 00:25:25 ++++ io.c 2005-03-05 00:32:06 +@@ -56,6 +56,7 @@ extern int remove_sent_files; + extern int preserve_hard_links; extern char *filesfrom_host; extern struct stats stats; ++extern time_t stop_at_utime; + extern struct file_list *the_file_list; -@@ -137,16 +138,24 @@ static void check_timeout(void) + const char phase_unknown[] = "unknown"; +@@ -163,16 +164,24 @@ static void check_timeout(void) { time_t t; @@ -41,7 +41,7 @@ Do we need configure support for mktime()? if (t - last_io >= io_timeout) { if (!am_server && !am_daemon) { rprintf(FERROR, "io timeout after %d seconds -- exiting\n", ---- orig/options.c 2005-03-01 05:49:24 +--- orig/options.c 2005-03-02 09:52:06 +++ options.c 2005-01-28 19:35:23 @@ -105,6 +105,7 @@ int checksum_seed = 0; int inplace = 0; @@ -130,9 +130,9 @@ Do we need configure support for mktime()? if (backup_dir) { args[ac++] = "--backup-dir"; args[ac++] = backup_dir; ---- orig/rsync.yo 2005-03-01 01:22:59 +--- orig/rsync.yo 2005-03-04 16:13:54 +++ rsync.yo 2005-02-01 10:46:35 -@@ -378,6 +378,8 @@ to the detailed description below for a +@@ -377,6 +377,8 @@ to the detailed description below for a --password-file=FILE read password from FILE --list-only list the files instead of copying them --bwlimit=KBPS limit I/O bandwidth; KBytes per second @@ -141,7 +141,7 @@ Do we need configure support for mktime()? --write-batch=FILE write a batched update to FILE --read-batch=FILE read a batched update from FILE --checksum-seed=NUM set block/file checksum seed (advanced) -@@ -1225,6 +1227,19 @@ transfer was too fast, it will wait befo +@@ -1247,6 +1249,19 @@ transfer was too fast, it will wait befo result is an average transfer rate equaling the specified limit. A value of zero specifies no limit. -- 2.34.1