Fixed failing hunks.
authorWayne Davison <wayned@samba.org>
Thu, 7 Dec 2006 04:32:04 +0000 (04:32 +0000)
committerWayne Davison <wayned@samba.org>
Thu, 7 Dec 2006 04:32:04 +0000 (04:32 +0000)
detect-renamed.diff
md5.diff

index 458d142..496e8d0 100644 (file)
@@ -42,7 +42,7 @@ TODO:
  extern int protocol_version;
  extern int sanitize_paths;
  extern struct stats stats;
-@@ -78,6 +79,8 @@ static dev_t tmp_rdev;
+@@ -77,6 +78,8 @@ static dev_t tmp_rdev;
  static struct idev tmp_idev;
  static char tmp_sum[MD4_SUM_LENGTH];
  
@@ -51,7 +51,7 @@ TODO:
  static char empty_sum[MD4_SUM_LENGTH];
  static int flist_count_offset;
  
-@@ -260,6 +263,44 @@ static mode_t from_wire_mode(int mode)
+@@ -259,6 +262,44 @@ static mode_t from_wire_mode(int mode)
        return mode;
  }
  
@@ -96,7 +96,7 @@ TODO:
  static void send_directory(int f, struct file_list *flist,
                           char *fbuf, int len);
  
-@@ -1395,6 +1436,25 @@ struct file_list *recv_file_list(int f)
+@@ -1411,6 +1452,25 @@ struct file_list *recv_file_list(int f)
  
        clean_flist(flist, relative_paths, 1);
  
@@ -124,7 +124,7 @@ TODO:
  
 --- old/generator.c
 +++ new/generator.c
-@@ -77,6 +77,7 @@ extern char *basis_dir[];
+@@ -76,6 +76,7 @@ extern char *basis_dir[];
  extern int compare_dest;
  extern int copy_dest;
  extern int link_dest;
@@ -132,7 +132,7 @@ TODO:
  extern int whole_file;
  extern int list_only;
  extern int new_root_dir;
-@@ -93,15 +94,18 @@ extern char *backup_dir;
+@@ -91,16 +92,19 @@ extern char *backup_dir;
  extern char *backup_suffix;
  extern int backup_suffix_len;
  extern struct file_list *the_file_list;
@@ -145,6 +145,7 @@ TODO:
  static int deletion_count = 0; /* used to implement --max-delete */
 +static int unexplored_dirs = 1;
  static FILE *delete_delay_fp = NULL;
+ static BOOL solo_file = 0;
  
 -/* For calling delete_item() and delete_dir_contents(). */
 +/* For calling delete_item(), delete_dir_contents(), and delete_in_dir(). */
@@ -152,7 +153,7 @@ TODO:
  #define DEL_RECURSE           (1<<1) /* recurse */
  #define DEL_DIR_IS_EMPTY      (1<<2) /* internal delete_FUNCTIONS use only */
  
-@@ -123,11 +127,121 @@ static int is_backup_file(char *fn)
+@@ -122,11 +126,121 @@ static int is_backup_file(char *fn)
        return k > 0 && strcmp(fn+k, backup_suffix) == 0;
  }
  
@@ -274,7 +275,7 @@ TODO:
   */
  static enum delret delete_item(char *fbuf, int mode, char *replace, int flags)
  {
-@@ -149,6 +263,8 @@ static enum delret delete_item(char *fbu
+@@ -148,6 +262,8 @@ static enum delret delete_item(char *fbu
                        goto check_ret;
                /* OK: try to delete the directory. */
        }
@@ -283,7 +284,7 @@ TODO:
  
        if (!replace && max_delete >= 0 && ++deletion_count > max_delete)
                return DR_AT_LIMIT;
-@@ -195,6 +311,8 @@ static enum delret delete_item(char *fbu
+@@ -194,6 +310,8 @@ static enum delret delete_item(char *fbu
   * its contents, otherwise just checks for content.  Returns DR_SUCCESS or
   * DR_NOT_EMPTY.  Note that fname must point to a MAXPATHLEN buffer!  (The
   * buffer is used for recursion, but returned unchanged.)
@@ -292,7 +293,7 @@ TODO:
   */
  static enum delret delete_dir_contents(char *fname, int flags)
  {
-@@ -251,6 +369,8 @@ static enum delret delete_dir_contents(c
+@@ -250,6 +368,8 @@ static enum delret delete_dir_contents(c
                if (S_ISDIR(fp->mode)
                 && delete_dir_contents(fname, flags | DEL_RECURSE) != DR_SUCCESS)
                        ret = DR_NOT_EMPTY;
@@ -301,7 +302,7 @@ TODO:
                if (delete_item(fname, fp->mode, NULL, flags) != DR_SUCCESS)
                        ret = DR_NOT_EMPTY;
        }
-@@ -335,15 +455,19 @@ static void delayed_deletions(char *delb
+@@ -334,15 +454,19 @@ static void delayed_deletions(char *delb
   * all the --delete-WHEN options.  Note that the fbuf pointer must point to a
   * MAXPATHLEN buffer with the name of the directory in it (the functions we
   * call will append names onto the end, but the old dir value will be restored
@@ -324,7 +325,7 @@ TODO:
        int dlen, i;
  
        if (!flist) {
-@@ -357,6 +481,8 @@ static void delete_in_dir(struct file_li
+@@ -356,6 +480,8 @@ static void delete_in_dir(struct file_li
        if (verbose > 2)
                rprintf(FINFO, "delete_in_dir(%s)\n", fbuf);
  
@@ -333,7 +334,7 @@ TODO:
        if (allowed_lull)
                maybe_send_keepalive();
  
-@@ -364,12 +490,14 @@ static void delete_in_dir(struct file_li
+@@ -363,12 +489,14 @@ static void delete_in_dir(struct file_li
                return; /* Impossible... */
  
        if (io_error && !(lp_ignore_errors(module_id) || ignore_errors)) {
@@ -353,7 +354,7 @@ TODO:
        }
  
        while (cur_depth >= file->dir.depth && cur_depth >= min_depth)
-@@ -380,6 +508,9 @@ static void delete_in_dir(struct file_li
+@@ -379,6 +507,9 @@ static void delete_in_dir(struct file_li
        dlen = strlen(fbuf);
        filt_array[cur_depth] = push_local_filters(fbuf, dlen);
  
@@ -363,7 +364,7 @@ TODO:
        if (one_file_system) {
                if (file->flags & FLAG_TOP_DIR)
                        filesystem_dev = stp->st_dev;
-@@ -389,6 +520,11 @@ static void delete_in_dir(struct file_li
+@@ -388,6 +519,11 @@ static void delete_in_dir(struct file_li
  
        dirlist = get_dirlist(fbuf, dlen, 0);
  
@@ -375,7 +376,7 @@ TODO:
        /* If an item in dirlist is not found in flist, delete it
         * from the filesystem. */
        for (i = dirlist->count; i--; ) {
-@@ -401,15 +537,22 @@ static void delete_in_dir(struct file_li
+@@ -400,15 +536,22 @@ static void delete_in_dir(struct file_li
                                        f_name(fp, NULL));
                        continue;
                }
@@ -401,7 +402,7 @@ TODO:
        flist_free(dirlist);
  }
  
-@@ -439,9 +582,9 @@ static void do_delete_pass(struct file_l
+@@ -438,9 +581,9 @@ static void do_delete_pass(struct file_l
                 || !S_ISDIR(st.st_mode))
                        continue;
  
@@ -413,7 +414,7 @@ TODO:
  
        if (do_progress && !am_server)
                rprintf(FINFO, "                    \r");
-@@ -966,6 +1109,7 @@ static int try_dests_non(struct file_str
+@@ -971,6 +1114,7 @@ static int try_dests_non(struct file_str
        return j;
  }
  
@@ -421,7 +422,7 @@ TODO:
  static int phase = 0;
  
  /* Acts on the_file_list->file's ndx'th item, whose name is fname.  If a dir,
-@@ -1152,8 +1296,12 @@ static void recv_generator(char *fname, 
+@@ -1157,8 +1301,12 @@ static void recv_generator(char *fname, 
                if (real_ret != 0 && one_file_system)
                        real_st.st_dev = filesystem_dev;
                if (delete_during && f_out != -1 && !phase && dry_run < 2
@@ -436,10 +437,10 @@ TODO:
                return;
        }
  
-@@ -1406,8 +1554,14 @@ static void recv_generator(char *fname, 
-                   && hard_link_check(file, ndx, fname, statret, &st,
+@@ -1429,8 +1577,14 @@ static void recv_generator(char *fname, 
                                       itemizing, code, HL_SKIP))
                        return;
+ #endif
 -              if (stat_errno == ENOENT)
 +              if (stat_errno == ENOENT) {
 +                      if (detect_renamed && unexplored_dirs > 0
@@ -452,7 +453,7 @@ TODO:
                rsyserr(FERROR, stat_errno, "recv_generator: failed to stat %s",
                        full_fname(fname));
                return;
-@@ -1593,13 +1747,19 @@ void generate_files(int f_out, struct fi
+@@ -1619,13 +1773,19 @@ void generate_files(int f_out, struct fi
                        (long)getpid(), flist->count);
        }
  
@@ -473,7 +474,7 @@ TODO:
                whole_file = 0;
        if (verbose >= 2) {
                rprintf(FINFO, "delta-transmission %s\n",
-@@ -1654,7 +1814,23 @@ void generate_files(int f_out, struct fi
+@@ -1682,7 +1842,23 @@ void generate_files(int f_out, struct fi
        }
        recv_generator(NULL, NULL, 0, 0, 0, code, -1);
        if (delete_during)
index 08c85bc..d48e910 100644 (file)
--- a/md5.diff
+++ b/md5.diff
@@ -563,15 +563,15 @@ To use this patch, run these commands for a successful build:
 +#endif /* md5.h */
 --- old/options.c
 +++ new/options.c
-@@ -117,6 +117,7 @@ int inplace = 0;
- int delay_updates = 0;
- long block_size = 0; /* "long" because popt can't set an int32. */
+@@ -101,6 +101,7 @@ int copy_unsafe_links = 0;
+ int size_only = 0;
+ int daemon_bwlimit = 0;
+ int bwlimit = 0;
 +int use_md5 = 0;
- /** Network address family. **/
- #ifdef INET6
-@@ -381,6 +382,7 @@ void usage(enum logcode F)
+ int fuzzy_basis = 0;
+ size_t bwlimit_writemax = 0;
+ int ignore_existing = 0;
+@@ -378,6 +379,7 @@ void usage(enum logcode F)
    rprintf(F,"     --only-write-batch=FILE like --write-batch but w/o updating destination\n");
    rprintf(F,"     --read-batch=FILE       read a batched update from FILE\n");
    rprintf(F,"     --protocol=NUM          force an older protocol version to be used\n");
@@ -579,7 +579,7 @@ To use this patch, run these commands for a successful build:
  #ifdef INET6
    rprintf(F," -4, --ipv4                  prefer IPv4\n");
    rprintf(F," -6, --ipv6                  prefer IPv6\n");
-@@ -494,6 +496,7 @@ static struct poptOption long_options[] 
+@@ -492,6 +494,7 @@ static struct poptOption long_options[] 
    {"whole-file",      'W', POPT_ARG_VAL,    &whole_file, 1, 0, 0 },
    {"no-whole-file",    0,  POPT_ARG_VAL,    &whole_file, 0, 0, 0 },
    {"no-W",             0,  POPT_ARG_VAL,    &whole_file, 0, 0, 0 },
@@ -587,7 +587,7 @@ To use this patch, run these commands for a successful build:
    {"checksum",        'c', POPT_ARG_NONE,   &always_checksum, 0, 0, 0 },
    {"block-size",      'B', POPT_ARG_LONG,   &block_size, 0, 0, 0 },
    {"compare-dest",     0,  POPT_ARG_STRING, 0, OPT_COMPARE_DEST, 0, 0 },
-@@ -1643,6 +1646,9 @@ void server_options(char **args,int *arg
+@@ -1646,6 +1649,9 @@ void server_options(char **args,int *arg
                args[ac++] = arg;
        }