On Tue, Aug 24, 2010 at 05:09:26AM +1200, Ralph Versteegen wrote:
> On 24 August 2010 04:26, James Paige <[email protected]> wrote:
> > On Mon, Aug 23, 2010 at 04:54:54AM -0700, [email protected] 
> > wrote:
> >> teeemcee
> >> 2010-08-23 04:54:54 -0700 (Mon, 23 Aug 2010)
> >> 300
> >> You can't move a file to a different mounted filesystem with rename(2), so 
> >> Vikings would crash for me while trying to upgrade.
> >>
> >> (Maybe this would have failed on Windows as well?)
> >>
> >> I left in some of my debugging code. Could be useful elsewhere, and those 
> >> blasted rename calls have broken on me before.
> >
> > What would be thge consequences of replacing this rename call with a
> > copy, followed by a delete? Seems like it would be safer, with only a
> > minor performance hit on something that only happens at upgrade anyway.
> 
> I don't know whether that would be safer. There are a huge number of
> different file IO errors that can happen either way. We should
> reallydo much more error detection around IO so that we can report
> errors when they occur, but I think preventing errors is hopeless
> (other than possibly giving an "Abort, Fail, Retry" prompt)

I agree.

> > lso, unless I totally missed something, this revision looks like it just
> > adds error handling for this situation without actually fixing it.
> 
> I changed the name of the temp file so that it's in the same directory
> instead of being put in tmpdir.

Aha! That is the part that I missed! Okay, I now understand why that 
would fix this particular problem.

But wouldn't this break if the rpgdir is on a read-only location? The 
reasonf for using tmpdir is that the rpgdir might have been installed 
system-wide by the package manager, in some place like 
/usr/share/games/vikings-of-midgard/

*goes to test*

Well, looks like we already have some other problems with that 
situation. Running a read-only rpgdir results in a red warning box with 
no text in it, and a debug log message about:

rpgfix:/usr/share/games/vikings-of-midgard/vikings.rpgdir not writeable
rpgfix:Making no attempt to upgrade.

My .deb files for Wandering Hamster and Vikings of Midgard are still 
okay, because they both install lumped rpg files, not unlumped rpgdirs.

---
James
_______________________________________________
Ohrrpgce mailing list
[email protected]
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org

Reply via email to