some easy createDirectoryUnder conversions
This commit is contained in:
parent
ebbc5004fa
commit
6d58ca94d6
12 changed files with 44 additions and 30 deletions
|
@ -70,9 +70,9 @@ storeLegacyChunked' meterupdate chunksize (d:dests) bs c = do
|
|||
feed bytes' (sz - s) ls h
|
||||
else return (l:ls)
|
||||
|
||||
storeHelper :: (FilePath -> FilePath -> IO ()) -> Key -> ([FilePath] -> IO [FilePath]) -> FilePath -> FilePath -> IO Bool
|
||||
storeHelper finalizer key storer tmpdir destdir = do
|
||||
void $ liftIO $ tryIO $ createDirectoryIfMissing True tmpdir
|
||||
storeHelper :: FilePath -> (FilePath -> FilePath -> IO ()) -> Key -> ([FilePath] -> IO [FilePath]) -> FilePath -> FilePath -> IO Bool
|
||||
storeHelper repotop finalizer key storer tmpdir destdir = do
|
||||
void $ liftIO $ tryIO $ createDirectoryUnder repotop tmpdir
|
||||
Legacy.storeChunks key tmpdir destdir storer recorder finalizer
|
||||
where
|
||||
recorder f s = do
|
||||
|
@ -80,8 +80,8 @@ storeHelper finalizer key storer tmpdir destdir = do
|
|||
writeFile f s
|
||||
void $ tryIO $ preventWrite f
|
||||
|
||||
store :: ChunkSize -> (FilePath -> FilePath -> IO ()) -> Key -> L.ByteString -> MeterUpdate -> FilePath -> FilePath -> IO Bool
|
||||
store chunksize finalizer k b p = storeHelper finalizer k $ \dests ->
|
||||
store :: FilePath -> ChunkSize -> (FilePath -> FilePath -> IO ()) -> Key -> L.ByteString -> MeterUpdate -> FilePath -> FilePath -> IO Bool
|
||||
store repotop chunksize finalizer k b p = storeHelper repotop finalizer k $ \dests ->
|
||||
storeLegacyChunked p chunksize dests b
|
||||
|
||||
{- Need to get a single ByteString containing every chunk.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue