Fixed failing hunk.
authorWayne Davison <wayned@samba.org>
Sun, 27 Feb 2005 07:52:39 +0000 (07:52 +0000)
committerWayne Davison <wayned@samba.org>
Sun, 27 Feb 2005 07:52:39 +0000 (07:52 +0000)
append.diff

index 45e19b5..fa5e9ca 100644 (file)
@@ -1,9 +1,9 @@
 This patch adds the --append option, which works like a "resume" mode in
 an ftp client, appending new data onto the end of the files it updates.
 
---- orig/generator.c   2005-02-23 02:57:26
-+++ generator.c        2005-02-15 19:31:13
-@@ -46,6 +46,7 @@ extern int remove_sent_files;
+--- orig/generator.c   2005-02-27 07:50:58
++++ generator.c        2005-02-27 07:51:38
+@@ -51,6 +51,7 @@ extern int remove_sent_files;
  extern int update_only;
  extern int opt_ignore_existing;
  extern int inplace;
@@ -11,7 +11,7 @@ an ftp client, appending new data onto the end of the files it updates.
  extern int make_backups;
  extern int csum_length;
  extern int ignore_times;
-@@ -245,35 +246,42 @@ static void generate_and_send_sums(int f
+@@ -457,35 +458,42 @@ static void generate_and_send_sums(int f
        OFF_T offset = 0;
  
        sum_sizes_sqroot(&sum, len);
@@ -61,7 +61,7 @@ an ftp client, appending new data onto the end of the files it updates.
        }
  
        if (mapbuf)
-@@ -733,6 +741,9 @@ static void recv_generator(char *fname, 
+@@ -925,6 +933,9 @@ static void recv_generator(char *fname, 
                return;
        }
  
@@ -71,7 +71,7 @@ an ftp client, appending new data onto the end of the files it updates.
        if (!compare_dest && fnamecmp_type <= FNAMECMP_BASIS_DIR_HIGH)
                ;
        else if (fnamecmp_type == FNAMECMP_FUZZY)
-@@ -759,7 +770,7 @@ prepare_to_open:
+@@ -951,7 +962,7 @@ prepare_to_open:
  
        if (dry_run || read_batch)
                goto notify_others;
@@ -80,16 +80,15 @@ an ftp client, appending new data onto the end of the files it updates.
                if (statret == 0)
                        statret = 1;
                goto notify_others;
-@@ -926,6 +937,9 @@ void generate_files(int f_out, struct fi
-       csum_length = SUM_LENGTH;
+@@ -1146,6 +1157,8 @@ void generate_files(int f_out, struct fi
        only_existing = max_size = opt_ignore_existing = 0;
        update_only = always_checksum = size_only = 0;
-+      make_backups = 0; /* avoid a duplicate backup in inplace mode */
+       ignore_times = 1;
 +      if (append_mode)  /* resend w/o append mode */
 +              append_mode = -1; /* ... but only longer files */
-       ignore_times = 1;
+       make_backups = 0; /* avoid a duplicate backup for inplace processing */
  
-       if (verbose > 2)
+       /* We expect to just sit around now, so don't exit on a timeout.
 --- orig/match.c       2005-02-15 19:27:04
 +++ match.c    2005-02-11 20:26:31
 @@ -23,6 +23,7 @@ extern int verbose;
@@ -131,7 +130,7 @@ an ftp client, appending new data onto the end of the files it updates.
                        matched(f, s, buf, j, -2);
                matched(f, s, buf, len, -1);
        }
---- orig/options.c     2005-02-23 02:57:26
+--- orig/options.c     2005-02-25 18:44:31
 +++ options.c  2005-02-16 15:36:40
 @@ -39,6 +39,7 @@ int make_backups = 0;
   **/
@@ -141,7 +140,7 @@ an ftp client, appending new data onto the end of the files it updates.
  int archive_mode = 0;
  int keep_dirlinks = 0;
  int copy_links = 0;
-@@ -162,6 +163,7 @@ static int F_option_cnt = 0;
+@@ -163,6 +164,7 @@ static int F_option_cnt = 0;
  static int modify_window_set;
  static int refused_delete, refused_archive_part;
  static int refused_partial, refused_progress, refused_delete_before;
@@ -149,7 +148,7 @@ an ftp client, appending new data onto the end of the files it updates.
  static char *dest_option = NULL;
  static char *max_size_arg;
  static char partialdir_for_delayupdate[] = ".~tmp~";
-@@ -271,6 +273,7 @@ void usage(enum logcode F)
+@@ -272,6 +274,7 @@ void usage(enum logcode F)
    rprintf(F,"     --suffix=SUFFIX         set backup suffix (default %s w/o --backup-dir)\n",BACKUP_SUFFIX);
    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");
@@ -157,7 +156,7 @@ an ftp client, appending new data onto the end of the files it updates.
    rprintf(F," -d, --dirs                  transfer directories without recursing\n");
    rprintf(F," -l, --links                 copy symlinks as symlinks\n");
    rprintf(F," -L, --copy-links            transform symlink into referent file/dir\n");
-@@ -397,6 +400,7 @@ static struct poptOption long_options[] 
+@@ -398,6 +401,7 @@ static struct poptOption long_options[] 
    {"links",           'l', POPT_ARG_NONE,   &preserve_links, 0, 0, 0 },
    {"copy-links",      'L', POPT_ARG_NONE,   &copy_links, 0, 0, 0 },
    {"keep-dirlinks",   'K', POPT_ARG_NONE,   &keep_dirlinks, 0, 0, 0 },
@@ -165,7 +164,7 @@ an ftp client, appending new data onto the end of the files it updates.
    {"whole-file",      'W', POPT_ARG_VAL,    &whole_file, 1, 0, 0 },
    {"no-whole-file",    0,  POPT_ARG_VAL,    &whole_file, 0, 0, 0 },
    {"copy-unsafe-links",0,  POPT_ARG_NONE,   &copy_unsafe_links, 0, 0, 0 },
-@@ -570,6 +574,8 @@ static void set_refuse_options(char *bp)
+@@ -571,6 +575,8 @@ static void set_refuse_options(char *bp)
                                                refused_partial = op->val;
                                        else if (wildmatch("progress", op->longName))
                                                refused_progress = op->val;
@@ -174,7 +173,7 @@ an ftp client, appending new data onto the end of the files it updates.
                                        break;
                                }
                                if (!is_wild)
-@@ -1115,6 +1121,14 @@ int parse_arguments(int *argc, const cha
+@@ -1114,6 +1120,14 @@ int parse_arguments(int *argc, const cha
                        bwlimit_writemax = 512;
        }
  
@@ -189,7 +188,7 @@ an ftp client, appending new data onto the end of the files it updates.
        if (delay_updates && !partial_dir)
                partial_dir = partialdir_for_delayupdate;
  
-@@ -1412,7 +1426,9 @@ void server_options(char **args,int *arg
+@@ -1413,7 +1427,9 @@ void server_options(char **args,int *arg
        if (opt_ignore_existing && am_sender)
                args[ac++] = "--ignore-existing";
  
@@ -200,9 +199,9 @@ an ftp client, appending new data onto the end of the files it updates.
                args[ac++] = "--inplace";
  
        if (tmpdir) {
---- orig/receiver.c    2005-02-20 20:55:51
+--- orig/receiver.c    2005-02-26 19:27:54
 +++ receiver.c 2005-02-11 20:26:32
-@@ -45,6 +45,7 @@ extern int remove_sent_files;
+@@ -44,6 +44,7 @@ extern int remove_sent_files;
  extern int module_id;
  extern int ignore_errors;
  extern int orig_umask;
@@ -210,7 +209,7 @@ an ftp client, appending new data onto the end of the files it updates.
  extern int keep_partial;
  extern int checksum_seed;
  extern int inplace;
-@@ -233,6 +234,28 @@ static int receive_data(int f_in, char *
+@@ -210,6 +211,28 @@ static int receive_data(int f_in, char *
  
        sum_init(checksum_seed);
  
@@ -239,7 +238,7 @@ an ftp client, appending new data onto the end of the files it updates.
        while ((i = recv_token(f_in, &data)) != 0) {
                if (do_progress)
                        show_progress(offset, total_size);
-@@ -422,6 +445,7 @@ int recv_files(int f_in, struct file_lis
+@@ -399,6 +422,7 @@ int recv_files(int f_in, struct file_lis
                        send_msg(MSG_DONE, "", 0);
                        if (keep_partial && !partial_dir)
                                make_backups = 0; /* prevents double backup */
@@ -247,7 +246,7 @@ an ftp client, appending new data onto the end of the files it updates.
                        continue;
                }
  
---- orig/rsync.yo      2005-02-23 02:57:27
+--- orig/rsync.yo      2005-02-26 05:22:51
 +++ rsync.yo   2005-02-11 20:36:38
 @@ -309,6 +309,7 @@ to the detailed description below for a 
       --suffix=SUFFIX         backup suffix (default ~ w/o --backup-dir)
@@ -272,7 +271,7 @@ an ftp client, appending new data onto the end of the files it updates.
  dit(bf(-d, --dirs)) Tell the sending side to include any directories that
  are encountered.  Unlike bf(--recursive), a directory's contents are not copied
  unless the directory was specified on the command-line as either "." or a
---- orig/sender.c      2005-02-23 02:57:27
+--- orig/sender.c      2005-02-26 03:22:59
 +++ sender.c   2005-02-20 00:17:01
 @@ -28,6 +28,7 @@ extern int log_format_has_i;
  extern int daemon_log_format_has_i;