Fixed failing hunks.
authorWayne Davison <wayned@samba.org>
Sat, 26 Feb 2005 19:35:20 +0000 (19:35 +0000)
committerWayne Davison <wayned@samba.org>
Sat, 26 Feb 2005 19:35:20 +0000 (19:35 +0000)
backup-dir-dels.diff
fname-convert.diff
source-cd.diff

index 36c18c6d1c8bf6212668c57bcbe4150041f938db..f45f0d71ddc39ebe976604904a2994c74344f58a 100644 (file)
@@ -106,9 +106,9 @@ Marc St-Onge
 +      deleting = 0;
 +      return ret;
 +}
---- orig/flist.c       2005-02-23 02:57:26
-+++ flist.c    2005-02-22 02:12:20
-@@ -67,6 +67,9 @@ extern char *log_format;
+--- orig/generator.c   2005-02-26 19:27:54
++++ generator.c        2005-02-26 19:31:06
+@@ -82,16 +82,23 @@ extern dev_t filesystem_dev;
  extern char *backup_dir;
  extern char *backup_suffix;
  extern int backup_suffix_len;
@@ -116,12 +116,11 @@ Marc St-Onge
 +extern char *backup_suffix_dels;
 +extern int backup_suffix_dels_len;
  
- extern char curr_dir[MAXPATHLEN];
-@@ -1775,10 +1778,14 @@ struct file_list *get_dirlist(const char
+ extern struct filter_list_struct server_filter_list;
  
  static int deletion_count = 0; /* used to implement --max-delete */
  
 +/* Function now checks if file matches backup- or delete-suffix patterns. */
  static int is_backup_file(char *fn)
  {
@@ -134,7 +133,18 @@ Marc St-Onge
  }
  
  
-@@ -1818,9 +1825,9 @@ int delete_file(char *fname, int mode, i
+@@ -109,8 +116,8 @@ static int delete_item(char *fname, int 
+               return -1;
+       if (!S_ISDIR(mode)) {
+-              if (make_backups && (backup_dir || !is_backup_file(fname)))
+-                      ok = make_backup(fname);
++              if (make_backups && (backup_dir_dels || !is_backup_file(fname)))
++                      ok = safe_delete(fname);
+               else
+                       ok = robust_unlink(fname) == 0;
+               if (ok) {
+@@ -131,9 +138,9 @@ static int delete_item(char *fname, int 
        if (dry_run && zap_dir) {
                ok = 0;
                errno = ENOTEMPTY;
@@ -146,9 +156,9 @@ Marc St-Onge
        else
                ok = do_rmdir(fname) == 0;
        if (ok) {
---- orig/options.c     2005-02-23 02:57:26
+--- orig/options.c     2005-02-25 18:44:31
 +++ options.c  2005-02-21 11:02:45
-@@ -126,10 +126,14 @@ int no_detach
+@@ -127,10 +127,14 @@ int no_detach
  int write_batch = 0;
  int read_batch = 0;
  int backup_dir_len = 0;
@@ -163,7 +173,7 @@ Marc St-Onge
  char *tmpdir = NULL;
  char *partial_dir = NULL;
  char *basis_dir[MAX_BASIS_DIRS+1];
-@@ -139,7 +143,9 @@ char *log_format = NULL;
+@@ -140,7 +144,9 @@ char *log_format = NULL;
  char *password_file = NULL;
  char *rsync_path = RSYNC_PATH;
  char *backup_dir = NULL;
@@ -173,7 +183,7 @@ Marc St-Onge
  int rsync_port = 0;
  int compare_dest = 0;
  int link_dest = 0;
-@@ -269,6 +275,8 @@ void usage(enum logcode F)
+@@ -270,6 +276,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);
@@ -182,7 +192,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");
-@@ -363,6 +371,7 @@ static struct poptOption long_options[] 
+@@ -364,6 +372,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 },
@@ -190,7 +200,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 },
-@@ -442,6 +451,7 @@ static struct poptOption long_options[] 
+@@ -443,6 +452,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 },
@@ -198,7 +208,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 },
-@@ -1005,6 +1015,8 @@ int parse_arguments(int *argc, const cha
+@@ -1004,6 +1014,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);
@@ -207,7 +217,7 @@ Marc St-Onge
                if (files_from)
                        files_from = sanitize_path(NULL, files_from, NULL, 0);
        }
-@@ -1037,6 +1049,12 @@ int parse_arguments(int *argc, const cha
+@@ -1036,6 +1048,12 @@ int parse_arguments(int *argc, const cha
                        if (check_filter(elp, backup_dir, 1) < 0)
                                goto options_rejected;
                }
@@ -220,7 +230,7 @@ Marc St-Onge
        }
        if (server_filter_list.head && files_from) {
                if (!*files_from)
-@@ -1059,6 +1077,16 @@ int parse_arguments(int *argc, const cha
+@@ -1058,6 +1076,16 @@ int parse_arguments(int *argc, const cha
                        backup_suffix);
                return 0;
        }
@@ -237,7 +247,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;
-@@ -1080,6 +1108,31 @@ int parse_arguments(int *argc, const cha
+@@ -1079,6 +1107,31 @@ int parse_arguments(int *argc, const cha
                        "--suffix cannot be a null string without --backup-dir\n");
                return 0;
        }
@@ -269,7 +279,7 @@ Marc St-Onge
        if (make_backups && !backup_dir)
                omit_dir_times = 1;
  
-@@ -1345,6 +1398,10 @@ void server_options(char **args,int *arg
+@@ -1346,6 +1399,10 @@ void server_options(char **args,int *arg
                args[ac++] = "--backup-dir";
                args[ac++] = backup_dir;
        }
@@ -280,7 +290,7 @@ Marc St-Onge
  
        /* Only send --suffix if it specifies a non-default value. */
        if (strcmp(backup_suffix, backup_dir ? "" : BACKUP_SUFFIX) != 0) {
-@@ -1353,7 +1410,13 @@ void server_options(char **args,int *arg
+@@ -1354,7 +1411,13 @@ void server_options(char **args,int *arg
                        goto oom;
                args[ac++] = arg;
        }
index 4d7d6700e86bd4e9bd6118e55025dac37b2fad16..c5db28030670c2f510c33dfb834b91d8d66d8daf 100644 (file)
@@ -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-26 05:22:50
-+++ flist.c    2005-02-26 05:23:26
-@@ -63,6 +63,7 @@ extern int force_delete;
+--- 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;
+ extern int protocol_version;
+ extern int sanitize_paths;
  extern int orig_umask;
- extern int make_backups;
- extern unsigned int curr_dir_len;
 +extern char *fname_convert_cmd;
- extern char *backup_dir;
- extern char *backup_suffix;
- extern int backup_suffix_len;
-@@ -345,7 +346,10 @@ void send_file_entry(struct file_struct 
+ extern char curr_dir[MAXPATHLEN];
+@@ -338,7 +339,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_
+@@ -554,6 +558,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, 
+@@ -1071,6 +1078,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, 
+@@ -1253,6 +1263,9 @@ struct file_list *send_file_list(int f, 
        stats.flist_size = stats.total_written - start_write;
        stats.num_files = flist->count;
  
@@ -137,9 +137,9 @@ Note that you'll need to run 'make proto' after applying this patch.
 +              cleanup_fname_convert();
 +
        if (verbose > 3)
-               output_flist(flist, who_am_i());
+               output_flist(flist);
  
-@@ -1277,6 +1290,9 @@ struct file_list *recv_file_list(int f)
+@@ -1274,6 +1287,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)
+@@ -1327,6 +1343,9 @@ struct file_list *recv_file_list(int f)
                        io_error |= read_int(f);
        }
  
@@ -157,7 +157,7 @@ Note that you'll need to run 'make proto' after applying this patch.
 +              cleanup_fname_convert();
 +
        if (verbose > 3)
-               output_flist(flist, who_am_i());
+               output_flist(flist);
  
 --- orig/fnameconv.c   2004-07-02 21:38:59
 +++ fnameconv.c        2004-07-02 21:38:59
@@ -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-26 03:22:59
+--- orig/generator.c   2005-02-26 19:27:54
 +++ generator.c        2005-02-03 02:07:33
-@@ -343,7 +343,13 @@ static int find_fuzzy(struct file_struct
+@@ -554,7 +554,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
@@ -398,7 +398,7 @@ Note that you'll need to run 'make proto' after applying this patch.
 + * reporting to the sender. */
  static void recv_generator(char *fname, struct file_list *flist,
                           struct file_struct *file, int ndx,
-                          int f_out, int f_out_name)
+                          int itemizing, int maybe_PERMS_REPORT,
 --- orig/log.c 2005-02-26 05:22:50
 +++ log.c      2004-07-03 20:18:02
 @@ -63,6 +63,7 @@ struct {
@@ -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-02-23 02:57:26
+--- orig/main.c        2005-02-26 19:27:54
 +++ main.c     2004-07-22 00:31:47
-@@ -363,7 +363,7 @@ static pid_t do_cmd(char *cmd, char *mac
+@@ -362,7 +362,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
index d479da5d866ea670d86895e2a1c1c93457865916..ab7872109578ac25542a32d29cc80f06cd55c3f7 100644 (file)
@@ -6,17 +6,17 @@ 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 05:22:50
-+++ flist.c    2005-02-26 05:24:15
-@@ -63,6 +63,7 @@ extern int force_delete;
+--- 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;
+ extern int protocol_version;
+ extern int sanitize_paths;
  extern int orig_umask;
- extern int make_backups;
- extern unsigned int curr_dir_len;
 +extern char *source_cd;
- extern char *backup_dir;
- extern char *backup_suffix;
- extern int backup_suffix_len;
-@@ -1078,13 +1079,14 @@ struct file_list *send_file_list(int f, 
+ extern char curr_dir[MAXPATHLEN];
+@@ -1075,13 +1076,14 @@ struct file_list *send_file_list(int f, 
  
        io_start_buffering_out();
        if (filesfrom_fd >= 0) {