[darcs-devel] [issue1753] darcs: opening of '_darcs/index' failed: does not exist (No such file or directory)

Ferenc Wágner bugs at darcs.net
Fri Mar 5 17:59:09 UTC 2010


Ferenc Wágner <wferi at niif.hu> added the comment:

Something like the change below would seem logical, and it even works to
some extent (but still only a shot in the dark):

hunk ./Storage/Hashed/Index.hs 212
   act_size <- if exist then fileSize `fmap` getFileStatus indexpath
                        else return 0
   let size :: Int
-      size = fromIntegral $
-                 if req_size > 0 then fromIntegral req_size else act_size
+      size = if req_size > 0 then req_size else fromIntegral act_size - size_magic
   case size of
     0 -> return (castForeignPtr nullForeignPtr, size)
     _ -> do (x, _, _) <- mmapFileForeignPtr indexpath
hunk ./Storage/Hashed/Index.hs 216
-                                         ReadWrite (Just (0, size + size_magic))
+                                         ReadWrite (Just (fromIntegral size_magic, size))
             return (x, size)
 
 data IndexM m = Index { mmap :: (ForeignPtr ())

Hmm, I see I lowered the priority of this bug. Sorry, it really wasn't
my intention, so I change it back to critical now...
Eek, maybe an email comment won't word-wrap the patch.

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/issue1753>
__________________________________


More information about the darcs-devel mailing list