A few more minor inprovements.
authorWayne Davison <wayned@samba.org>
Tue, 15 Feb 2005 23:14:10 +0000 (23:14 +0000)
committerWayne Davison <wayned@samba.org>
Tue, 15 Feb 2005 23:14:10 +0000 (23:14 +0000)
remove-sent-files.diff

index d85234f..3da9d17 100644 (file)
@@ -5,7 +5,7 @@ command before "make":
 
 
 --- orig/generator.c   2005-02-15 20:40:53
-+++ generator.c        2005-02-15 20:43:59
++++ generator.c        2005-02-15 21:33:51
 @@ -38,6 +38,7 @@ extern int preserve_gid;
  extern int preserve_times;
  extern int omit_dir_times;
@@ -18,7 +18,7 @@ command before "make":
                                    itemize_changes ? "" : safe_fname(fname),
                                    safe_fname(file->u.link));
                        }
-+                      if (remove_sent_files) {
++                      if (remove_sent_files && !dry_run) {
 +                              char numbuf[4];
 +                              SIVAL(numbuf, 0, ndx);
 +                              io_multiplex_write(MSG_SUCCESS, numbuf, 4);
@@ -27,7 +27,7 @@ command before "make":
  #endif
                return;
 --- orig/io.c  2005-02-03 02:04:20
-+++ io.c       2005-02-15 20:43:59
++++ io.c       2005-02-15 21:33:51
 @@ -244,6 +244,14 @@ static void read_msg_fd(void)
                read_loop(fd, buf, 4);
                redo_list_add(IVAL(buf,0));
@@ -61,7 +61,7 @@ command before "make":
                case MSG_ERROR:
                        if (remaining >= sizeof line) {
 --- orig/main.c        2005-02-15 19:27:04
-+++ main.c     2005-02-15 20:43:59
++++ main.c     2005-02-15 21:33:51
 @@ -33,12 +33,14 @@ extern int verbose;
  extern int itemize_changes;
  extern int blocking_io;
@@ -109,8 +109,8 @@ command before "make":
        if (argc == 0)
                list_only |= 1;
  
---- orig/options.c     2005-02-15 19:27:05
-+++ options.c  2005-02-15 20:44:00
+--- orig/options.c     2005-02-15 21:14:55
++++ options.c  2005-02-15 21:33:52
 @@ -59,6 +59,7 @@ int delete_during = 0;
  int delete_before = 0;
  int delete_after = 0;
@@ -131,7 +131,7 @@ command before "make":
    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");
-+  rprintf(F,"     --remove-sent-files     updated/sent files are removed from sending side\n");
++  rprintf(F,"     --remove-sent-files     sent files/symlinks are removed from sending side\n");
    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");
@@ -143,12 +143,12 @@ 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 },
-@@ -961,6 +965,14 @@ int parse_arguments(int *argc, const cha
+@@ -968,6 +972,14 @@ int parse_arguments(int *argc, const cha
                return 0;
        }
  
 +      if (remove_sent_files) {
-+              if (refused_delete) {
++              if (refused_delete && am_sender) {
 +                      create_refuse_error(refused_delete);
 +                      return 0;
 +              }
@@ -158,7 +158,7 @@ command before "make":
        *argv = poptGetArgs(pc);
        *argc = count_args(*argv);
  
-@@ -1393,6 +1405,9 @@ void server_options(char **args,int *arg
+@@ -1400,6 +1412,9 @@ void server_options(char **args,int *arg
        if (fuzzy_basis && am_sender)
                args[ac++] = "--fuzzy";
  
@@ -169,7 +169,7 @@ command before "make":
        return;
  
 --- orig/receiver.c    2005-02-15 19:27:05
-+++ receiver.c 2005-02-15 20:44:00
++++ receiver.c 2005-02-15 21:33:52
 @@ -42,6 +42,7 @@ extern int basis_dir_cnt;
  extern int make_backups;
  extern int do_progress;
@@ -214,12 +214,12 @@ command before "make":
                }
        }
 --- orig/rsync.h       2005-02-15 19:27:05
-+++ rsync.h    2005-02-15 20:44:00
++++ rsync.h    2005-02-15 21:33:53
 @@ -62,6 +62,7 @@
  #define FLAG_MOUNT_POINT (1<<2)       /* sender only */
  #define FLAG_NO_FUZZY (1<<2)  /* generator only */
  #define FLAG_DEL_HERE (1<<3)  /* receiver/generator */
-+#define FLAG_SENT (1<<7)      /* sender only */
++#define FLAG_SENT (1<<3)      /* sender only */
  
  /* update this if you make incompatible changes */
  #define PROTOCOL_VERSION 29
@@ -232,7 +232,7 @@ command before "make":
        MSG_REDO=4,     /* reprocess indicated flist index */
        MSG_ERROR=FERROR, MSG_INFO=FINFO, MSG_LOG=FLOG, /* remote logging */
 --- orig/rsync.yo      2005-02-15 20:42:04
-+++ rsync.yo   2005-02-15 20:44:02
++++ rsync.yo   2005-02-15 21:33:55
 @@ -332,6 +332,7 @@ to the detailed description below for a 
       --rsync-path=PATH       specify path to rsync on the remote machine
       --existing              only update files that already exist
@@ -245,16 +245,29 @@ command before "make":
  This tells rsync not to update files that already exist on
  the destination.
  
-+dit(bf(--remove-sent-files)) This tells rsync to remove the source files
-+on the sending side that are successfully transferred to the receiving
-+side.  Directories and devices are not removed, nor are files/symlinks
-+whose content was not updated (just changing attributes does not count).
++dit(bf(--remove-sent-files)) This tells rsync to remove from the sending
++side the files and/or symlinks that are newly created or whose content is
++updated on the receiving side.  Directories and devices are not removed,
++nor are files/symlinks whose attributes are merely changed.
 +
  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-11 10:53:15
++++ rsyncd.conf.yo     2005-02-15 21:33:55
+@@ -411,6 +411,10 @@ quote(tt(    refuse options = c delete))
+ The reason the above refuses all delete options is that the options imply
+ bf(--delete), and implied options are refused just like explicit options.
++As an additional safety feature, the refusal of "delete" also refuses
++bf(remove-sent-files) when the daemon is the sender; if you want the latter
++without the former, instead refuse "delete-*" -- that refuses all the
++delete modes without affecting bf(--remove-sent-files).
+ 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-15 19:27:05
-+++ sender.c   2005-02-15 20:44:02
++++ sender.c   2005-02-15 21:33:55
 @@ -27,6 +27,7 @@ extern int io_error;
  extern int dry_run;
  extern int am_server;