rsync 2.5.5 --delete-after option bug

Wayne Davison wayned at users.sourceforge.net
Thu Apr 25 15:06:01 EST 2002


On Thu, 25 Apr 2002, Dave Dykstra wrote:
> I think --delete-after should imply --delete.  Would someone like to
> work up the simple patch to the code and the man page?

Sure.  Here's one (note that the OPT_DELETE_AFTER enum was already
defined for some reason).

..wayne..

---8<------8<------8<------8<---cut here--->8------>8------>8------>8---
Index: options.c
--- options.c	16 Apr 2002 01:38:21 -0000	1.92
+++ options.c	25 Apr 2002 21:57:48 -0000
@@ -306,7 +306,7 @@
   {"delete",           0,  POPT_ARG_NONE,   &delete_mode , 0, 0, 0 },
   {"existing",         0,  POPT_ARG_NONE,   &only_existing , 0, 0, 0 },
   {"ignore-existing",  0,  POPT_ARG_NONE,   &opt_ignore_existing , 0, 0, 0 },
-  {"delete-after",     0,  POPT_ARG_NONE,   &delete_after , 0, 0, 0 },
+  {"delete-after",     0,  POPT_ARG_NONE,   0,              OPT_DELETE_AFTER, 0, 0 },
   {"delete-excluded",  0,  POPT_ARG_NONE,   0,              OPT_DELETE_EXCLUDED, 0, 0 },
   {"force",            0,  POPT_ARG_NONE,   &force_delete , 0, 0, 0 },
   {"numeric-ids",      0,  POPT_ARG_NONE,   &numeric_ids , 0, 0, 0 },
@@ -476,7 +479,12 @@
                          * non-default setting. */
 			modify_window_set = 1;
 			break;
-
+
+		case OPT_DELETE_AFTER:
+			delete_after = 1;
+			delete_mode = 1;
+			break;
+
 		case OPT_DELETE_EXCLUDED:
 			delete_excluded = 1;
 			delete_mode = 1;
Index: rsync.yo
--- rsync.yo	8 Apr 2002 05:30:28 -0000	1.96
+++ rsync.yo	25 Apr 2002 22:01:47 -0000
@@ -485,11 +485,12 @@
 dit(bf(--delete-excluded)) In addition to deleting the files on the
 receiving side that are not on the sending side, this tells rsync to also
 delete any files on the receiving side that are excluded (see --exclude).
+Implies --delete.

 dit(bf(--delete-after)) By default rsync does file deletions before
 transferring files to try to ensure that there is sufficient space on
 the receiving filesystem. If you want to delete after transferring
-then use the --delete-after switch.
+then use the --delete-after switch. Implies --delete.

 dit(bf(--ignore-errors)) Tells --delete to go ahead and delete files
 even when there are IO errors.
---8<------8<------8<------8<---cut here--->8------>8------>8------>8---





More information about the rsync mailing list