Fixed failing hunks.
authorWayne Davison <wayned@samba.org>
Sun, 20 Feb 2005 00:18:07 +0000 (00:18 +0000)
committerWayne Davison <wayned@samba.org>
Sun, 20 Feb 2005 00:18:07 +0000 (00:18 +0000)
acls.diff
append.diff
backup-dir-dels.diff
fsync.diff
owner-group-mod.diff
remove-sent-files.diff

index a7d056a..f2f64da 100644 (file)
--- a/acls.diff
+++ b/acls.diff
@@ -1285,9 +1285,9 @@ ACLs to a non-ACL-supporting disk should complain.
  AC_CONFIG_FILES([Makefile lib/dummy zlib/dummy popt/dummy shconfig])
  AC_OUTPUT
  
---- orig/flist.c       2005-02-14 02:45:10
+--- orig/flist.c       2005-02-20 00:02:23
 +++ flist.c    2005-02-14 02:45:34
-@@ -978,6 +978,8 @@ void send_file_name(int f, struct file_l
+@@ -974,6 +974,8 @@ void send_file_name(int f, struct file_l
        file = make_file(fname, flist, f == -2 ? SERVER_FILTERS : ALL_FILTERS);
        if (!file)
                return;
@@ -1296,7 +1296,7 @@ ACLs to a non-ACL-supporting disk should complain.
  
        maybe_emit_filelist_progress(flist);
  
-@@ -986,6 +988,10 @@ void send_file_name(int f, struct file_l
+@@ -982,6 +984,10 @@ void send_file_name(int f, struct file_l
        if (file->basename[0]) {
                flist->files[flist->count++] = file;
                send_file_entry(file, f, base_flags);
@@ -1307,7 +1307,7 @@ ACLs to a non-ACL-supporting disk should complain.
        }
  
        if (recursive && S_ISDIR(file->mode)
-@@ -1296,6 +1302,8 @@ struct file_list *recv_file_list(int f)
+@@ -1292,6 +1298,8 @@ struct file_list *recv_file_list(int f)
                        flags |= read_byte(f) << 8;
                file = receive_file_entry(flist, flags, f);
  
@@ -1316,7 +1316,7 @@ ACLs to a non-ACL-supporting disk should complain.
                if (S_ISREG(file->mode))
                        stats.total_size += file->length;
  
-@@ -1318,6 +1326,8 @@ struct file_list *recv_file_list(int f)
+@@ -1314,6 +1322,8 @@ struct file_list *recv_file_list(int f)
  
        clean_flist(flist, relative_paths, 1);
  
@@ -1325,12 +1325,12 @@ ACLs to a non-ACL-supporting disk should complain.
        if (f >= 0) {
                /* Now send the uid/gid list. This was introduced in
                 * protocol version 15 */
---- orig/generator.c   2005-02-18 20:17:34
-+++ generator.c        2005-01-30 10:09:44
-@@ -451,6 +451,10 @@ static void recv_generator(char *fname, 
+--- orig/generator.c   2005-02-20 00:02:23
++++ generator.c        2005-02-20 00:02:51
+@@ -492,6 +492,10 @@ static void recv_generator(char *fname, 
                if (set_perms(fname, file, statret ? NULL : &st, 0)
-                   && verbose && protocol_version < 29 && f_out != -1)
-                       rprintf(FINFO, "%s/\n", safe_fname(fname));
+                   && verbose && code && f_out != -1)
+                       rprintf(code, "%s/\n", safe_fname(fname));
 +#if SUPPORT_ACLS
 +              if (f_out == -1)
 +                      SET_ACL(fname, file);
@@ -4597,7 +4597,7 @@ ACLs to a non-ACL-supporting disk should complain.
    next;
  }
  
---- orig/options.c     2005-02-18 18:02:45
+--- orig/options.c     2005-02-20 00:02:23
 +++ options.c  2005-02-14 02:46:05
 @@ -44,6 +44,7 @@ int keep_dirlinks = 0;
  int copy_links = 0;
@@ -4607,7 +4607,7 @@ ACLs to a non-ACL-supporting disk should complain.
  int preserve_perms = 0;
  int preserve_devices = 0;
  int preserve_uid = 0;
-@@ -169,6 +170,7 @@ static void print_rsync_version(enum log
+@@ -171,6 +172,7 @@ static void print_rsync_version(enum log
        char const *got_socketpair = "no ";
        char const *have_inplace = "no ";
        char const *hardlinks = "no ";
@@ -4615,7 +4615,7 @@ ACLs to a non-ACL-supporting disk should complain.
        char const *links = "no ";
        char const *ipv6 = "no ";
        STRUCT_STAT *dumstat;
-@@ -185,6 +187,10 @@ static void print_rsync_version(enum log
+@@ -187,6 +189,10 @@ static void print_rsync_version(enum log
        hardlinks = "";
  #endif
  
@@ -4626,7 +4626,7 @@ ACLs to a non-ACL-supporting disk should complain.
  #ifdef SUPPORT_LINKS
        links = "";
  #endif
-@@ -199,9 +205,9 @@ static void print_rsync_version(enum log
+@@ -201,9 +207,9 @@ static void print_rsync_version(enum log
                "Copyright (C) 1996-2005 by Andrew Tridgell and others\n");
        rprintf(f, "<http://rsync.samba.org/>\n");
        rprintf(f, "Capabilities: %d-bit files, %ssocketpairs, "
@@ -4638,7 +4638,7 @@ ACLs to a non-ACL-supporting disk should complain.
  
        /* Note that this field may not have type ino_t.  It depends
         * on the complicated interaction between largefile feature
-@@ -271,6 +277,7 @@ void usage(enum logcode F)
+@@ -273,6 +279,7 @@ void usage(enum logcode F)
    rprintf(F," -H, --hard-links            preserve hard links\n");
    rprintf(F," -K, --keep-dirlinks         treat symlinked dir on receiver as dir\n");
    rprintf(F," -p, --perms                 preserve permissions\n");
@@ -4646,7 +4646,7 @@ ACLs to a non-ACL-supporting disk should complain.
    rprintf(F," -o, --owner                 preserve owner (root only)\n");
    rprintf(F," -g, --group                 preserve group\n");
    rprintf(F," -D, --devices               preserve devices (root only)\n");
-@@ -392,6 +399,7 @@ static struct poptOption long_options[] 
+@@ -394,6 +401,7 @@ static struct poptOption long_options[] 
    {"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 },
    {"perms",           'p', POPT_ARG_NONE,   &preserve_perms, 0, 0, 0 },
@@ -4654,7 +4654,7 @@ ACLs to a non-ACL-supporting disk should complain.
    {"owner",           'o', POPT_ARG_NONE,   &preserve_uid, 0, 0, 0 },
    {"group",           'g', POPT_ARG_NONE,   &preserve_gid, 0, 0, 0 },
    {"devices",         'D', POPT_ARG_NONE,   &preserve_devices, 0, 0, 0 },
-@@ -837,6 +845,24 @@ int parse_arguments(int *argc, const cha
+@@ -849,6 +857,24 @@ int parse_arguments(int *argc, const cha
                        basis_dir[basis_dir_cnt++] = (char *)arg;
                        break;
  
@@ -4679,7 +4679,7 @@ ACLs to a non-ACL-supporting disk should complain.
                default:
                        /* A large opt value means that set_refuse_options()
                         * turned this option off. */
-@@ -1226,6 +1252,8 @@ void server_options(char **args,int *arg
+@@ -1242,6 +1268,8 @@ void server_options(char **args,int *arg
  
        if (preserve_hard_links)
                argstr[x++] = 'H';
@@ -4688,9 +4688,9 @@ ACLs to a non-ACL-supporting disk should complain.
        if (preserve_uid)
                argstr[x++] = 'o';
        if (preserve_gid)
---- orig/rsync.c       2005-02-14 02:45:10
+--- orig/rsync.c       2005-02-20 00:02:23
 +++ rsync.c    2004-07-03 20:11:58
-@@ -238,6 +238,14 @@ int set_perms(char *fname,struct file_st
+@@ -255,6 +255,14 @@ int set_perms(char *fname,struct file_st
        }
  #endif
  
@@ -4703,11 +4703,11 @@ ACLs to a non-ACL-supporting disk should complain.
 +      }
 +
        if (verbose > 1 && flags & PERMS_REPORT) {
-               if (updated)
-                       rprintf(FINFO, "%s\n", safe_fname(fname));
---- orig/rsync.h       2005-02-16 17:08:13
+               enum logcode code = daemon_log_format_has_i || dry_run
+                                 ? FCLIENT : FINFO;
+--- orig/rsync.h       2005-02-20 00:02:23
 +++ rsync.h    2004-07-03 20:11:58
-@@ -625,6 +625,40 @@ struct stats {
+@@ -627,6 +627,40 @@ struct stats {
  #include "lib/permstring.h"
  #include "lib/addrinfo.h"
  
@@ -4748,7 +4748,7 @@ ACLs to a non-ACL-supporting disk should complain.
  #include "proto.h"
  
  /* We have replacement versions of these if they're missing. */
---- orig/rsync.yo      2005-02-18 20:17:35
+--- orig/rsync.yo      2005-02-19 09:27:49
 +++ rsync.yo   2004-07-03 20:11:58
 @@ -317,6 +317,7 @@ to the detailed description below for a 
   -H, --hard-links            preserve hard links
index 758d854..951c2c1 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-18 20:17:34
+--- orig/generator.c   2005-02-20 00:02:23
 +++ generator.c        2005-02-15 19:31:13
-@@ -41,6 +41,7 @@ extern int delete_during;
+@@ -45,6 +45,7 @@ extern int delete_during;
  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;
-@@ -234,35 +235,42 @@ static void generate_and_send_sums(int f
+@@ -242,35 +243,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)
-@@ -689,6 +697,9 @@ static void recv_generator(char *fname, 
+@@ -729,6 +737,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)
-@@ -715,7 +726,7 @@ prepare_to_open:
+@@ -755,7 +766,7 @@ prepare_to_open:
  
        if (dry_run || read_batch)
                goto notify_others;
@@ -80,7 +80,7 @@ an ftp client, appending new data onto the end of the files it updates.
                if (statret == 0)
                        statret = 1;
                goto notify_others;
-@@ -881,6 +892,9 @@ void generate_files(int f_out, struct fi
+@@ -921,6 +932,9 @@ void generate_files(int f_out, struct fi
        csum_length = SUM_LENGTH;
        only_existing = max_size = opt_ignore_existing = 0;
        update_only = always_checksum = size_only = 0;
@@ -131,7 +131,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-18 18:02:45
+--- orig/options.c     2005-02-20 00:02:23
 +++ options.c  2005-02-16 15:36:40
 @@ -39,6 +39,7 @@ int make_backups = 0;
   **/
@@ -141,7 +141,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;
-@@ -154,6 +155,7 @@ static int F_option_cnt = 0;
+@@ -156,6 +157,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 +149,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~";
-@@ -263,6 +265,7 @@ void usage(enum logcode F)
+@@ -265,6 +267,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 +157,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");
-@@ -388,6 +391,7 @@ static struct poptOption long_options[] 
+@@ -390,6 +393,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 +165,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 },
-@@ -561,6 +565,8 @@ static void set_refuse_options(char *bp)
+@@ -562,6 +566,8 @@ static void set_refuse_options(char *bp)
                                                refused_partial = op->val;
                                        else if (wildmatch("progress", op->longName))
                                                refused_progress = op->val;
@@ -174,7 +174,7 @@ an ftp client, appending new data onto the end of the files it updates.
                                        break;
                                }
                                if (!is_wild)
-@@ -1083,6 +1089,14 @@ int parse_arguments(int *argc, const cha
+@@ -1099,6 +1105,14 @@ int parse_arguments(int *argc, const cha
                        bwlimit_writemax = 512;
        }
  
@@ -189,7 +189,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;
  
-@@ -1369,7 +1383,9 @@ void server_options(char **args,int *arg
+@@ -1396,7 +1410,9 @@ void server_options(char **args,int *arg
        if (opt_ignore_existing && am_sender)
                args[ac++] = "--ignore-existing";
  
@@ -200,9 +200,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-18 20:17:35
+--- orig/receiver.c    2005-02-20 00:16:35
 +++ receiver.c 2005-02-11 20:26:32
-@@ -46,6 +46,7 @@ extern int cleanup_got_literal;
+@@ -44,6 +44,7 @@ extern int cleanup_got_literal;
  extern int module_id;
  extern int ignore_errors;
  extern int orig_umask;
@@ -210,7 +210,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;
-@@ -167,6 +168,28 @@ static int receive_data(int f_in, char *
+@@ -169,6 +170,28 @@ static int receive_data(int f_in, char *
  
        sum_init(checksum_seed);
  
@@ -239,7 +239,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);
-@@ -359,6 +382,7 @@ int recv_files(int f_in, struct file_lis
+@@ -363,6 +386,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 +247,7 @@ an ftp client, appending new data onto the end of the files it updates.
                        continue;
                }
  
---- orig/rsync.yo      2005-02-18 20:17:35
+--- orig/rsync.yo      2005-02-19 09:27:49
 +++ 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,16 +272,16 @@ 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-18 20:17:35
-+++ sender.c   2005-02-16 15:36:53
-@@ -33,6 +33,7 @@ extern int updating_basis_file;
- extern int make_backups;
- extern int do_progress;
- extern int inplace;
+--- orig/sender.c      2005-02-20 00:16:35
++++ 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;
+ extern int csum_length;
+ extern int io_error;
 +extern int append_mode;
- extern char *log_format;
- extern struct stats stats;
+ extern int protocol_version;
+ extern int updating_basis_file;
+ extern int make_backups;
 @@ -66,6 +67,13 @@ static struct sum_struct *receive_sums(i
                        (double)s->count, (long)s->blength, (long)s->remainder);
        }
@@ -296,7 +296,7 @@ an ftp client, appending new data onto the end of the files it updates.
        if (s->count == 0)
                return(s);
  
-@@ -131,6 +139,7 @@ void send_files(struct file_list *flist,
+@@ -133,6 +141,7 @@ void send_files(struct file_list *flist,
                                /* For inplace: redo phase turns off the backup
                                 * flag so that we do a regular inplace send. */
                                make_backups = 0;
index d88a1f2..5ed084f 100644 (file)
@@ -105,55 +105,7 @@ Marc St-Onge
 +      deleting = 0;
 +      return ret;
 +}
---- 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;
- extern char *backup_suffix;
-+extern char *backup_dir_rm;
-+extern char *backup_suffix_rm;
- extern int filesfrom_fd;
- extern int one_file_system;
-@@ -60,6 +62,7 @@ extern int relative_paths;
- extern int implied_dirs;
- extern int make_backups;
- extern int backup_suffix_len;
-+extern int backup_suffix_rm_len;
- extern int copy_links;
- extern int copy_unsafe_links;
- extern int protocol_version;
-@@ -1751,10 +1754,14 @@ char *f_name(struct file_struct *f)
- }
-+/* Function now checks if file matches backup or delete suffix patterns */
- static int is_backup_file(char *fn)
- {
-       int k = strlen(fn) - backup_suffix_len;
--      return k > 0 && strcmp(fn+k, backup_suffix) == 0;
-+      if (k > 0 && strcmp(fn+k, backup_suffix) == 0)
-+              return 1;
-+      k += backup_suffix_len - backup_suffix_rm_len;
-+      return k > 0 && strcmp(fn+k, backup_suffix_rm) == 0;
- }
- struct file_list *get_dirlist(const char *dirname, int ignore_filter_rules)
-@@ -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]);
--                      if (make_backups && (backup_dir || !is_backup_file(f))
-+                      int backup_file = is_backup_file(f);
-+                      if (make_backups && (backup_dir_rm || !backup_file)
-                         && !S_ISDIR(mode)) {
--                              make_backup(f);
-+                              safe_delete(f);
-                               if (verbose || log_format)
-                                       log_delete(f, mode);
-                       } else if (S_ISDIR(mode))
---- orig/options.c     2005-02-19 09:27:48
+--- orig/options.c     2005-02-20 00:02:23
 +++ options.c  2005-01-28 19:17:35
 @@ -119,10 +119,14 @@ int no_detach = 0;
  int write_batch = 0;
@@ -180,7 +132,7 @@ Marc St-Onge
  int rsync_port = 0;
  int compare_dest = 0;
  int copy_dest = 0;
-@@ -262,6 +268,8 @@ void usage(enum logcode F)
+@@ -263,6 +269,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);
@@ -189,7 +141,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");
-@@ -356,6 +364,7 @@ static struct poptOption long_options[] 
+@@ -357,6 +365,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 },
@@ -197,7 +149,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 },
-@@ -435,6 +444,7 @@ static struct poptOption long_options[] 
+@@ -436,6 +445,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 },
@@ -205,7 +157,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 },
-@@ -980,6 +990,8 @@ int parse_arguments(int *argc, const cha
+@@ -991,6 +1001,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);
@@ -214,7 +166,7 @@ Marc St-Onge
                if (files_from)
                        files_from = sanitize_path(NULL, files_from, NULL, 0);
        }
-@@ -1012,6 +1024,12 @@ int parse_arguments(int *argc, const cha
+@@ -1023,6 +1035,12 @@ int parse_arguments(int *argc, const cha
                        if (check_filter(elp, backup_dir, 1) < 0)
                                goto options_rejected;
                }
@@ -227,7 +179,7 @@ Marc St-Onge
        }
        if (server_filter_list.head && files_from) {
                if (!*files_from)
-@@ -1034,6 +1052,16 @@ int parse_arguments(int *argc, const cha
+@@ -1045,6 +1063,16 @@ int parse_arguments(int *argc, const cha
                        backup_suffix);
                return 0;
        }
@@ -244,7 +196,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;
-@@ -1055,6 +1083,31 @@ int parse_arguments(int *argc, const cha
+@@ -1066,6 +1094,31 @@ int parse_arguments(int *argc, const cha
                        "--suffix cannot be a null string without --backup-dir\n");
                return 0;
        }
@@ -276,7 +228,7 @@ Marc St-Onge
  
        if (log_format) {
                if (strstr(log_format, "%i") != NULL)
-@@ -1318,6 +1371,10 @@ void server_options(char **args,int *arg
+@@ -1329,6 +1382,10 @@ void server_options(char **args,int *arg
                args[ac++] = "--backup-dir";
                args[ac++] = backup_dir;
        }
@@ -287,7 +239,7 @@ Marc St-Onge
  
        /* Only send --suffix if it specifies a non-default value. */
        if (strcmp(backup_suffix, backup_dir ? "" : BACKUP_SUFFIX) != 0) {
-@@ -1326,7 +1383,13 @@ void server_options(char **args,int *arg
+@@ -1337,7 +1394,13 @@ void server_options(char **args,int *arg
                        goto oom;
                args[ac++] = arg;
        }
@@ -302,3 +254,38 @@ Marc St-Onge
        if (am_sender) {
                if (delete_excluded)
                        args[ac++] = "--delete-excluded";
+--- orig/rsync.c       2005-02-20 00:02:23
++++ rsync.c    2005-02-20 00:05:49
+@@ -44,12 +44,19 @@ extern char *backup_dir;
+ extern char *log_format;
+ extern char *backup_suffix;
+ extern int backup_suffix_len;
++extern char *backup_dir_rm;
++extern char *backup_suffix_rm;
++extern int backup_suffix_rm_len;
++/* Function now checks if file matches backup or delete suffix patterns */
+ static int is_backup_file(char *fn)
+ {
+       int k = strlen(fn) - backup_suffix_len;
+-      return k > 0 && strcmp(fn+k, backup_suffix) == 0;
++      if (k > 0 && strcmp(fn+k, backup_suffix) == 0)
++              return 1;
++      k += backup_suffix_len - backup_suffix_rm_len;
++      return k > 0 && strcmp(fn+k, backup_suffix_rm) == 0;
+ }
+@@ -82,8 +89,9 @@ int delete_file(char *fname, int mode, i
+       if (!S_ISDIR(mode)) {
+               int ok;
+-              if (make_backups && (backup_dir || !is_backup_file(fname)))
+-                      ok = make_backup(fname);
++              int backup_file = is_backup_file(f);
++              if (make_backups && (backup_dir_rm || !backup_file))
++                      ok = safe_delete(fname);
+               else
+                       ok = robust_unlink(fname) == 0;
+               if (ok) {
index f380cda..d96b9b5 100644 (file)
@@ -1,7 +1,7 @@
 This patch from Sami Farin lets you specify --fsync if you want fsync()
 to be called on every file we write.
 
---- orig/options.c     2005-02-01 10:39:22
+--- orig/options.c     2005-02-20 00:02:23
 +++ options.c  2005-01-28 19:30:47
 @@ -39,6 +39,7 @@ int make_backups = 0;
   **/
@@ -11,7 +11,7 @@ to be called on every file we write.
  int archive_mode = 0;
  int keep_dirlinks = 0;
  int copy_links = 0;
-@@ -294,6 +295,7 @@ void usage(enum logcode F)
+@@ -301,6 +302,7 @@ void usage(enum logcode F)
    rprintf(F,"     --partial               keep partially transferred files\n");
    rprintf(F,"     --partial-dir=DIR       put a partially transferred file into DIR\n");
    rprintf(F,"     --delay-updates         put all updated files into place at transfer's end\n");
@@ -19,7 +19,7 @@ to be called on every file we write.
    rprintf(F,"     --numeric-ids           don't map uid/gid values by user/group name\n");
    rprintf(F,"     --timeout=TIME          set I/O timeout in seconds\n");
    rprintf(F," -I, --ignore-times          don't skip files that match in size and mod-time\n");
-@@ -371,6 +373,7 @@ static struct poptOption long_options[] 
+@@ -381,6 +383,7 @@ static struct poptOption long_options[] 
    {"safe-links",       0,  POPT_ARG_NONE,   &safe_symlinks, 0, 0, 0 },
    {"help",            'h', POPT_ARG_NONE,   0, 'h', 0, 0 },
    {"backup",          'b', POPT_ARG_NONE,   &make_backups, 0, 0, 0 },
@@ -27,7 +27,7 @@ to be called on every file we write.
    {"dry-run",         'n', POPT_ARG_NONE,   &dry_run, 0, 0, 0 },
    {"sparse",          'S', POPT_ARG_NONE,   &sparse_files, 0, 0, 0 },
    {"cvs-exclude",     'C', POPT_ARG_NONE,   &cvs_exclude, 0, 0, 0 },
-@@ -1293,6 +1296,9 @@ void server_options(char **args,int *arg
+@@ -1404,6 +1407,9 @@ void server_options(char **args,int *arg
                args[ac++] = tmpdir;
        }
  
@@ -37,17 +37,17 @@ to be called on every file we write.
        if (basis_dir[0] && am_sender) {
                /* the server only needs this option if it is not the sender,
                 *   and it may be an older version that doesn't know this
---- orig/receiver.c    2005-02-03 02:04:20
-+++ receiver.c 2004-07-16 20:13:31
-@@ -34,6 +34,7 @@ extern int keep_dirlinks;
+--- orig/receiver.c    2005-02-20 00:16:35
++++ receiver.c 2005-02-20 00:17:37
+@@ -38,6 +38,7 @@ extern int keep_dirlinks;
  extern int preserve_hard_links;
  extern int preserve_perms;
  extern int io_error;
 +extern int do_fsync;
- extern char *tmpdir;
- extern char *partial_dir;
- extern char *basis_dir[];
-@@ -242,6 +243,12 @@ static int receive_data(int f_in, char *
+ extern int basis_dir_cnt;
+ extern int make_backups;
+ extern int cleanup_got_literal;
+@@ -248,6 +249,12 @@ static int receive_data(int f_in, char *
                exit_cleanup(RERR_FILEIO);
        }
  
@@ -70,7 +70,7 @@ to be called on every file we write.
  char *partial_dir;
  struct filter_list_struct server_filter_list;
  
---- orig/util.c        2005-01-28 19:08:20
+--- orig/util.c        2005-02-18 20:17:35
 +++ util.c     2004-07-03 20:18:13
 @@ -33,6 +33,7 @@ extern int module_id;
  extern int modify_window;
index 7fca7bf..ed56748 100644 (file)
@@ -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-19 09:27:48
-+++ compat.c   2005-02-19 09:33:44
-@@ -29,11 +29,14 @@ int remote_protocol = 0;
+--- orig/compat.c      2005-02-20 00:02:22
++++ compat.c   2005-02-20 00:09:11
+@@ -28,11 +28,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)
-@@ -93,4 +96,11 @@ void setup_protocol(int f_out,int f_in)
+@@ -89,4 +92,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-19 09:27:48
+--- orig/options.c     2005-02-20 00:02:23
 +++ options.c  2004-09-09 01:59:08
-@@ -393,8 +393,8 @@ static struct poptOption long_options[] 
+@@ -394,8 +394,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,   &copy_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 },
-@@ -723,6 +723,14 @@ int parse_arguments(int *argc, const cha
+@@ -734,6 +734,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;
-@@ -933,8 +941,8 @@ int parse_arguments(int *argc, const cha
+@@ -944,8 +952,8 @@ int parse_arguments(int *argc, const cha
  #endif
                preserve_perms = 1;
                preserve_times = 1;
@@ -73,8 +73,8 @@ groups, even if they weren't returned by getgroups().  E.g.:
                preserve_devices = 1;
        }
  
-@@ -1233,10 +1241,16 @@ void server_options(char **args,int *arg
-               argstr[x++] = 'i';
+@@ -1242,10 +1250,16 @@ void server_options(char **args,int *arg
        if (preserve_hard_links)
                argstr[x++] = 'H';
 -      if (preserve_uid)
@@ -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-19 09:27:48
+--- orig/rsync.c       2005-02-20 00:02:23
 +++ rsync.c    2005-02-01 10:46:04
 @@ -27,7 +27,6 @@ extern int dry_run;
- extern int itemize_changes;
+ extern int daemon_log_format_has_i;
  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;
-@@ -174,7 +173,7 @@ int set_perms(char *fname,struct file_st
+@@ -199,7 +198,7 @@ int set_perms(char *fname,struct file_st
                updated = 1;
        }
  
index a554e69..2cf615c 100644 (file)
@@ -4,9 +4,9 @@ command before "make":
     make proto
 
 
---- orig/generator.c   2005-02-19 09:27:48
+--- orig/generator.c   2005-02-20 00:02:23
 +++ generator.c        2005-02-15 21:33:51
-@@ -38,6 +38,7 @@ extern int preserve_gid;
+@@ -42,6 +42,7 @@ extern int preserve_gid;
  extern int preserve_times;
  extern int omit_dir_times;
  extern int delete_during;
@@ -14,8 +14,8 @@ command before "make":
  extern int update_only;
  extern int opt_ignore_existing;
  extern int inplace;
-@@ -518,6 +519,11 @@ static void recv_generator(char *fname, 
-                               rprintf(FINFO, "%s -> %s\n", safe_fname(fname),
+@@ -559,6 +560,11 @@ static void recv_generator(char *fname, 
+                               rprintf(code, "%s -> %s\n", safe_fname(fname),
                                        safe_fname(file->u.link));
                        }
 +                      if (remove_sent_files && !dry_run) {
@@ -60,23 +60,18 @@ command before "make":
                case MSG_INFO:
                case MSG_ERROR:
                        if (remaining >= sizeof line) {
---- orig/main.c        2005-02-16 17:08:13
-+++ main.c     2005-02-15 21:33:51
-@@ -32,12 +32,14 @@ extern int am_daemon;
- extern int verbose;
+--- orig/main.c        2005-02-20 00:02:23
++++ main.c     2005-02-20 00:09:59
+@@ -33,7 +33,9 @@ extern int am_generator;
+ extern int am_daemon;
  extern int blocking_io;
  extern int delete_before;
 +extern int remove_sent_files;
  extern int daemon_over_rsh;
++extern int need_messages_from_generator;
  extern int do_stats;
- extern int dry_run;
- extern int list_only;
  extern int log_got_error;
  extern int module_id;
-+extern int need_messages_from_generator;
- extern int orig_umask;
- extern int copy_links;
- extern int keep_dirlinks;
 @@ -441,6 +443,12 @@ static void do_server_sender(int f_in, i
                exit_cleanup(RERR_SYNTAX);
                return;
@@ -109,7 +104,7 @@ command before "make":
        if (argc == 0)
                list_only |= 1;
  
---- orig/options.c     2005-02-19 09:27:48
+--- orig/options.c     2005-02-20 00:02:23
 +++ options.c  2005-02-15 21:33:52
 @@ -59,6 +59,7 @@ int delete_during = 0;
  int delete_before = 0;
@@ -127,7 +122,7 @@ command before "make":
  int max_delete = 0;
  OFF_T max_size = 0;
  int ignore_errors = 0;
-@@ -287,6 +289,7 @@ void usage(enum logcode F)
+@@ -288,6 +290,7 @@ void usage(enum logcode F)
    rprintf(F,"     --rsync-path=PATH       specify path to rsync on the remote machine\n");
    rprintf(F,"     --existing              only update files that already exist on receiver\n");
    rprintf(F,"     --ignore-existing       ignore files that already exist on receiving side\n");
@@ -135,7 +130,7 @@ command before "make":
    rprintf(F,"     --del                   an alias for --delete-during\n");
    rprintf(F,"     --delete                delete files that don't exist on the sending side\n");
    rprintf(F,"     --delete-before         receiver deletes before transfer (default)\n");
-@@ -370,6 +373,7 @@ static struct poptOption long_options[] 
+@@ -371,6 +374,7 @@ static struct poptOption long_options[] 
    {"delete-during",    0,  POPT_ARG_NONE,   &delete_during, 0, 0, 0 },
    {"delete-after",     0,  POPT_ARG_NONE,   &delete_after, 0, 0, 0 },
    {"delete-excluded",  0,  POPT_ARG_NONE,   &delete_excluded, 0, 0, 0 },
@@ -143,7 +138,7 @@ command before "make":
    {"force",            0,  POPT_ARG_NONE,   &force_delete, 0, 0, 0 },
    {"numeric-ids",      0,  POPT_ARG_NONE,   &numeric_ids, 0, 0, 0 },
    {"filter",          'f', POPT_ARG_STRING, 0, OPT_FILTER, 0, 0 },
-@@ -967,6 +971,17 @@ int parse_arguments(int *argc, const cha
+@@ -978,6 +982,17 @@ int parse_arguments(int *argc, const cha
                return 0;
        }
  
@@ -161,7 +156,7 @@ command before "make":
        *argv = poptGetArgs(pc);
        *argc = count_args(*argv);
  
-@@ -1424,6 +1439,9 @@ void server_options(char **args,int *arg
+@@ -1435,6 +1450,9 @@ void server_options(char **args,int *arg
        if (fuzzy_basis && am_sender)
                args[ac++] = "--fuzzy";
  
@@ -171,9 +166,9 @@ command before "make":
        *argc = ac;
        return;
  
---- orig/receiver.c    2005-02-19 09:27:48
+--- orig/receiver.c    2005-02-20 00:02:23
 +++ receiver.c 2005-02-15 21:33:52
-@@ -43,6 +43,7 @@ extern int basis_dir_cnt;
+@@ -45,6 +45,7 @@ extern int basis_dir_cnt;
  extern int make_backups;
  extern int do_progress;
  extern int cleanup_got_literal;
@@ -181,7 +176,7 @@ command before "make":
  extern int module_id;
  extern int ignore_errors;
  extern int orig_umask;
-@@ -310,7 +311,7 @@ int recv_files(int f_in, struct file_lis
+@@ -312,7 +313,7 @@ int recv_files(int f_in, struct file_lis
        char *fname, fbuf[MAXPATHLEN];
        char template[MAXPATHLEN];
        char fnametmp[MAXPATHLEN];
@@ -190,7 +185,7 @@ command before "make":
        char fnamecmpbuf[MAXPATHLEN];
        uchar *delayed_bits = NULL;
        struct file_struct *file;
-@@ -591,7 +592,12 @@ int recv_files(int f_in, struct file_lis
+@@ -595,7 +596,12 @@ int recv_files(int f_in, struct file_lis
  
                cleanup_disable();
  
@@ -204,7 +199,7 @@ command before "make":
                        int msgtype = csum_length == SUM_LENGTH || read_batch ?
                                FERROR : FINFO;
                        if (msgtype == FERROR || verbose) {
-@@ -615,9 +621,8 @@ int recv_files(int f_in, struct file_lis
+@@ -619,9 +625,8 @@ int recv_files(int f_in, struct file_lis
                                        keptstr, redostr);
                        }
                        if (csum_length != SUM_LENGTH) {
@@ -238,7 +233,7 @@ command before "make":
  dit(bf(--delete)) This tells rsync to delete extraneous files from the
  receiving side (ones that aren't on the sending side), but only for the
  directories that are being synchronized.  You must have asked rsync to
---- orig/rsyncd.conf.yo        2005-02-19 09:27:49
+--- orig/rsyncd.conf.yo        2005-02-20 00:02:23
 +++ rsyncd.conf.yo     2005-02-15 21:33:55
 @@ -459,6 +459,10 @@ quote(tt(    refuse options = c delete))
  
@@ -251,17 +246,17 @@ command before "make":
  
  When an option is refused, the server prints an error message and exits.
  To prevent all compression, you can use "dont compress = *" (see below)
---- orig/sender.c      2005-02-19 09:27:49
-+++ sender.c   2005-02-15 21:33:55
-@@ -28,6 +28,7 @@ extern int io_error;
- extern int dry_run;
- extern int am_server;
- extern int am_daemon;
-+extern int remove_sent_files;
+--- orig/sender.c      2005-02-20 00:02:23
++++ sender.c   2005-02-20 00:10:24
+@@ -30,6 +30,7 @@ extern int csum_length;
+ extern struct stats stats;
+ extern int io_error;
  extern int protocol_version;
++extern int remove_sent_files;
  extern int updating_basis_file;
  extern int make_backups;
-@@ -98,7 +99,32 @@ static struct sum_struct *receive_sums(i
+ extern int do_progress;
+@@ -99,7 +100,32 @@ static struct sum_struct *receive_sums(i
        return s;
  }
  
@@ -294,7 +289,7 @@ command before "make":
  
  void send_files(struct file_list *flist, int f_out, int f_in)
  {
-@@ -117,6 +143,8 @@ void send_files(struct file_list *flist,
+@@ -120,6 +146,8 @@ void send_files(struct file_list *flist,
        if (verbose > 2)
                rprintf(FINFO, "send_files starting\n");
  
@@ -303,7 +298,7 @@ command before "make":
        while (1) {
                unsigned int offset;
  
-@@ -282,6 +310,9 @@ void send_files(struct file_list *flist,
+@@ -286,6 +314,9 @@ void send_files(struct file_list *flist,
                        rprintf(FINFO, "sender finished %s\n",
                                safe_fname(fname));
                }