Possible bug not deleting files

Wayne Davison wayned at samba.org
Fri May 27 18:16:29 GMT 2005


On Thu, May 26, 2005 at 08:06:36PM -0700, Omen Wild wrote:
> /usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded \
>  --exclude-from=/home/omen/.backup/rsnapshot \
>  /home/ \
>  /var/cache/rsnapshot/snapshots/daily.0/balrog/

This was fixed in the latest pre-release, via this patch:

    http://lists.samba.org/archive/rsync/2005-April/012338.html

> I tried applying the patch in
> http://www.mail-archive.com/rsync@lists.samba.org/msg13492.html
> but rsync then totally skips even the 'deleting in home/.' line.

The code now needs to preserve FLAG_TOP_DIR when removing duplicates
from the file list.  The attached patch does this.

The latest nightly tar file (linked on the rsync web page) has all these
fixes applied (and an improved testsuite to catch problems like this in
the future).

Thanks for the report!

..wayne..
-------------- next part --------------
--- flist.c	25 May 2005 01:24:01 -0000	1.295
+++ flist.c	27 May 2005 18:14:01 -0000
@@ -1524,8 +1524,8 @@ static void clean_flist(struct file_list
 			}
 			/* Make sure that if we unduplicate '.', that we don't
 			 * lose track of a user-specified top directory. */
-			if (flist->files[drop]->flags & FLAG_TOP_DIR)
-				flist->files[keep]->flags |= FLAG_TOP_DIR;
+			flist->files[keep]->flags |= flist->files[drop]->flags
+						   & (FLAG_TOP_DIR|FLAG_DEL_HERE);
 
 			clear_file(drop, flist);
 


More information about the rsync mailing list