%f bug in --out-format, patch for 2.6.9 ? (better mail formating)

reno reno at faubourg.org
Mon Jul 2 13:32:21 GMT 2007


Matt McCutchen wrote:
> On 7/1/07, reno <reno at faubourg.org> wrote:
>> I'm experiencing various output bugs using --out-format with %f in 
>> rsync 2.6.9
>
> You seem to expect that %f will always give you an absolute path, but
> that's not what it is designed to do.  In the rsyncd.conf man page,
> "long form on sender" means only that you see the source path you gave
> on the command line.  If you want absolute paths in the log, use an
> absolute source path.  Deletions are logged by the receiving side, and
> on the receiving side, %f is only meant to give you the path inside
> the file-list.  If you want absolute paths, your script has to prepend
> the absolute destination path to each logged path itself, perhaps
> using "sed".
>
> See this thread for more information:
> http://lists.samba.org/archive/rsync/2007-June/017875.html
>
>> $ rsync -ntr --out-format="%o %f" --delete source/ destination
>> del. home/renard/test/delete.txt    (should be "del. 
>> home/renard/test/destination/delete.txt")
>
> As per my comment above, the expected output path is "delete.txt", not
> "home/renard/test/destination/delete.txt"...
>
>> - Fixed a problem with the --out-format (aka --log-format) option: it 
>> would output superfluous directory
>> information for a non-daemon rsync.
>
> ...and that snippet refers to the bug that the "home/renard/test" part
> appears.  The attached patch for rsync 2.6.9 fixes the bug.
>
>> $ rsync -ntr --out-format="%o %f" --delete 127.0.0.1::renard/source/ 
>> destination
>> del. home/renard/test/destination/delete.txt  (correct)
>
> Not really; this is another example of the bug and the expected output
> is "delete.txt".
>
> Matt
> ------------------------------------------------------------------------
>
> --- old/log.c
> +++ new/log.c
> @@ -514,7 +514,7 @@
>  					strlcpy(n, buf2, MAXPATHLEN);
>  				else
>  					n = buf2;
> -			} else if (*n != '/') {
> +			} else if (am_daemon && *n != '/') {
>  				pathjoin(buf2, sizeof buf2,
>  					 curr_dir + module_dirlen, n);
>  				clean_fname(buf2, 0);
>   
Thanks for your fast an clear answer.
I will apply the patch and go back to work.

renaud Cabrol


More information about the rsync mailing list