[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn rev 7611: FAIL (i386-unknown-freebsdelf5.0 static ra_local)

From: Branko Čibej <brane_at_xbc.nu>
Date: 2003-11-03 16:19:51 CET

Sander Striker wrote:

>>From: Branko Cibej [mailto:brane@xbc.nu]
>>Sent: Monday, November 03, 2003 8:01 AM
>>
>>
>>brane@xbc.nu wrote:
>>
>>
>>
>>>BUILD: Revision 7611 on i386-unknown-freebsdelf5.0 static
>>>
>>>
>>...
>>
>>
>>
>>>Running all tests in merge_tests.py...FAILURE
>>>
>>>
>>(fails everywhere else, too)
>>
>>I think this is a consequence of the move to use apr_tmp_dir_get in
>>revision 7609. Both of my test machines have /tmp and /home on mounted
>>on different volumes; now apr_file_renams on Unix just calls rename(2),
>>which does not support cross-volume renames and returns EXDEV instead.
>>
>>I think this is an APR misfeature. The docs on apr_file_rename say that
>>"Moving files or directories across devices may not be possible," but I
>>think the workaround is so simple that APR should just implement it
>>internally The Windows implementation of apr_file_rename does revert to
>>copy+delete on cross-volume renames.
>>
>>Thoughts?
>>
>>
>
>Something like this? (needs win32 counterpart)
>
>Index: file_io/unix/open.c
>===================================================================
>RCS file: /home/cvs/apr/file_io/unix/open.c,v
>retrieving revision 1.111
>diff -u -r1.111 open.c
>--- file_io/unix/open.c 19 Mar 2003 03:45:42 -0000 1.111
>+++ file_io/unix/open.c 3 Nov 2003 12:18:47 -0000
>@@ -216,7 +216,17 @@
> const char *to_path,
> apr_pool_t *p)
> {
>+ apr_status_t rv;
>+
> if (rename(from_path, to_path) != 0) {
>+ if (errno == EXDEV) {
>+ rv = apr_file_copy(from_path, to_path, APR_FILE_SOURCE_PERMS, p);
>+ if (rv)
>+ return rv;
>+
>+ return apr_file_remove(from_path, p);
>+ }
>+
> return errno;
> }
> return APR_SUCCESS;
>
>
Yup, that's what I had in mind. Of course, the note in the docstring
should go away, too.

>And temporarily in Subversion, until APR with such a fix is released:
>
>* subversion/libsvn_subr/io.c
>
> (file_copy): New helper function.
>
> (svn_io_copy_file): Use helper.
>
> (svn_io_rename_file): If rename isn't possible because it is cross filesystem,
> copy and delete instead. Use helper.
>
>
Since it's temporary, I think we can live without the helper function.
All we gain with the helper is two less string conversions, which I
think shouldn't matter at this point. Or maybe it does; if the next APR
release is far in the future?

-- 
Brane Čibej   <brane_at_xbc.nu>   http://www.xbc.nu/brane/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Nov 3 16:20:42 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.