You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Philip Martin <ph...@codematters.co.uk> on 2006/07/13 18:50:31 UTC
Re: svn commit: r20632 - trunk/build/ac-macros
maxb@tigris.org writes:
> + # This little dance satisfies Cygwin, which cannot overwrite in-use files.
> + if test -f "$1"; then
> + mv "$1" "$1.old"
> + rm -f "$1.old"
> + fi
I don't understand that, should the comment say "delete" instead of
"overwrite"? I'm surprised that mv/rm works if plain rm fails!
--
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: svn commit: r20632 - trunk/build/ac-macros
Posted by Malcolm Rowe <ma...@farside.org.uk>.
On Fri, Jul 14, 2006 at 12:14:48AM +0100, Philip Martin wrote:
> Malcolm Rowe <ma...@farside.org.uk> writes:
>
> > we'd then need another check as
> > to whether config.nice.old exists before we try deleting it.
>
> I'd expect a plain "rm -f" to be enough, we use it already in
> configure.in.
>
Yes, sorry. It was the 'mv' that was previously generating an error,
not the 'rm'.
Regards,
Malcolm
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: svn commit: r20632 - trunk/build/ac-macros
Posted by Philip Martin <ph...@codematters.co.uk>.
Malcolm Rowe <ma...@farside.org.uk> writes:
> we'd then need another check as
> to whether config.nice.old exists before we try deleting it.
I'd expect a plain "rm -f" to be enough, we use it already in
configure.in.
--
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: svn commit: r20632 - trunk/build/ac-macros
Posted by Malcolm Rowe <ma...@farside.org.uk>.
On Thu, Jul 13, 2006 at 08:14:06PM +0100, Philip Martin wrote:
> Malcolm Rowe <ma...@farside.org.uk> writes:
>
> > On Thu, Jul 13, 2006 at 07:50:31PM +0100, Philip Martin wrote:
> >> maxb@tigris.org writes:
> >>
> >> > + # This little dance satisfies Cygwin, which cannot overwrite in-use files.
> >> > + if test -f "$1"; then
> >> > + mv "$1" "$1.old"
> >> > + rm -f "$1.old"
> >> > + fi
>
> So when running the script config.nice on Cygwin it's not possible
> simply to overwrite the file config.nice, because it's open, and
> although it's possible to delete config.nice that still doesn't allow
> the file config.nice to be written.
>
Yes, that's how Max explained it to me. The original config.nice doesn't
get deleted until the current invocation exits (regardless of when the
'rm' occurs). So we can rename it and write a new config.nice, then
queue the original for deletion.
> Is the rm optional, i.e., is renaming config.nice enough to allow a new
> config.nice to be written? If so then it would make more sense to
> delay the rm until after the new config.nice has been written.
>
We could delay the deletion, AIUI, but we'd then need another check as
to whether config.nice.old exists before we try deleting it.
Regards,
Malcolm
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: svn commit: r20632 - trunk/build/ac-macros
Posted by Philip Martin <ph...@codematters.co.uk>.
Malcolm Rowe <ma...@farside.org.uk> writes:
> On Thu, Jul 13, 2006 at 07:50:31PM +0100, Philip Martin wrote:
>> maxb@tigris.org writes:
>>
>> > + # This little dance satisfies Cygwin, which cannot overwrite in-use files.
>> > + if test -f "$1"; then
>> > + mv "$1" "$1.old"
>> > + rm -f "$1.old"
>> > + fi
>>
>> I don't understand that, should the comment say "delete" instead of
>> "overwrite"? I'm surprised that mv/rm works if plain rm fails!
>>
>
> No, I asked this too. Apparently Cygwin can delete in-use files (it deletes
> on last close), but it can't write over in-use files.
I'm wondering whether I really want to understand this :)
So when running the script config.nice on Cygwin it's not possible
simply to overwrite the file config.nice, because it's open, and
although it's possible to delete config.nice that still doesn't allow
the file config.nice to be written.
Is the rm optional, i.e., is renaming config.nice enough to allow a new
config.nice to be written? If so then it would make more sense to
delay the rm until after the new config.nice has been written.
--
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: svn commit: r20632 - trunk/build/ac-macros
Posted by Malcolm Rowe <ma...@farside.org.uk>.
On Thu, Jul 13, 2006 at 07:50:31PM +0100, Philip Martin wrote:
> maxb@tigris.org writes:
>
> > + # This little dance satisfies Cygwin, which cannot overwrite in-use files.
> > + if test -f "$1"; then
> > + mv "$1" "$1.old"
> > + rm -f "$1.old"
> > + fi
>
> I don't understand that, should the comment say "delete" instead of
> "overwrite"? I'm surprised that mv/rm works if plain rm fails!
>
No, I asked this too. Apparently Cygwin can delete in-use files (it deletes
on last close), but it can't write over in-use files.
Regards,
Malcolm
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org