-v prints directories twice

Dave Dykstra dwd at bell-labs.com
Tue Dec 4 05:33:56 EST 2001

Does it bother anybody else that -v prints directories twice?  It first
prints all affected directories and files in recursive order and then
prints new directories again.  I can't recall noticing that rsync always
did that, but I don't think it's a very recent change.

The directory is being printed both times by recv_generator(), and I
checked CVS and it's been there since the beginning of generator.c.
Investigation told me that the second time around it is fixing up the
modification time directories that had some file in them change during the
run, done by a special call from recv_files() in receiver.c.  I note that
on that special call, the f_out parameter is set to -1 so the following
little patch fixes it.

I think this is simple enough that I'll just submit it to the rsync CVS as
one of the small changes I put in.

- Dave Dykstra

--- generator.c.O       Mon Dec  3 12:29:31 2001
+++ generator.c Mon Dec  3 12:27:04 2001
@@ -247,7 +247,9 @@
-               if (set_perms(fname,file,NULL,0) && verbose) 
+               /* f_out is set to -1 when doing final directory 
+                  permission and modification time repair */
+               if (set_perms(fname,file,NULL,0) && verbose && (f_out != -1)) 

More information about the rsync mailing list