hashed-storage 0.5 → 0.5.1
raw patch · 2 files changed
+7/−3 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Storage/Hashed/Index.hs +6/−2
- hashed-storage.cabal +1/−1
Storage/Hashed/Index.hs view
@@ -50,13 +50,14 @@ getFileStatus, fileSize, fileExists ) import System.IO.MMap( mmapFileForeignPtr, mmapFileByteString, Mode(..) ) import System.IO( )-import System.Directory( doesFileExist )+import System.Directory( doesFileExist, getCurrentDirectory ) #if mingw32_HOST_OS import System.Directory( renameFile ) import System.FilePath( (<.>) ) #else import System.Directory( removeFile ) #endif+import System.FilePath( (</>) ) import Control.Monad( when ) import Control.Exception.Extensible@@ -220,6 +221,7 @@ return (x, size) data IndexM m = Index { mmap :: (ForeignPtr ())+ , basedir :: FilePath , hashtree :: Tree m -> Hash , predicate :: AnchoredPath -> TreeItem m -> Bool } | EmptyIndex@@ -291,7 +293,7 @@ size <- xlatePeek64 $ iSize item let mtime' = modificationTime st size' = fromIntegral $ fileSize st- readblob = readSegment (BSC.unpack $ iPath item, Nothing)+ readblob = readSegment (basedir index </> BSC.unpack (iPath item), Nothing) exists = fileExists st we_changed = mtime /= mtime' || size /= size' hash = iHash' item@@ -329,8 +331,10 @@ readIndex :: FilePath -> (Tree IO -> Hash) -> IO Index readIndex indexpath ht = do (mmap_ptr, mmap_size) <- mmapIndex indexpath 0+ base <- getCurrentDirectory return $ if mmap_size == 0 then EmptyIndex else Index { mmap = mmap_ptr+ , basedir = base , hashtree = ht , predicate = \_ _ -> True }
hashed-storage.cabal view
@@ -1,5 +1,5 @@ name: hashed-storage-version: 0.5+version: 0.5.1 synopsis: Hashed file storage support code. description: Support code for reading and manipulating hashed file storage