Using --keep-dirlinks : recursive symlinks problem

Ivan S. Manida Ivan.Manida at Sun.COM
Mon Aug 30 14:48:04 GMT 2004


Wayne,

It seems that this unique directory detection is being used when 
building delete lists as well; so the contents of all directories which 
have symlinks pointing to them is being removed if you use 
--keep-dirlinks together with --delete, and then transferred again.

That's expected since link_stat() resolves links to dirs at the very 
start of make_file(), but I could not fix it since I'm not very familiar 
with the rsync code. Adding the check to link_stat() (to not replace 
link info with the directory it points to if saw_dir() returns true) 
does not seem to fix the problem, so I'm out of ideas.

thanks for the help.


Wayne Davison wrote:

  > Seems like the only good solution for this is to keep track of the
> device and inode of all the dirs we visit so that we can eliminate all
> duplicate directories.  Attached is a patch that does this using a
> simple binary insertion sort.  Very minimally tested.  Thoughts?
> Optimizations?
> 
> ..wayne..
> 

-- 
Ivan S. Manida, cdev/buildmaster
Sun SPb: 33033, Bld. 1, Room 217


More information about the rsync mailing list