more RawFilePath conversion
at 377/645 This commit was sponsored by Svenne Krap on Patreon.
This commit is contained in:
parent
f45ad178cb
commit
681b44236a
23 changed files with 215 additions and 188 deletions
|
@ -93,8 +93,9 @@ mkRetrievalVerifiableKeysSecure gc
|
|||
fileStorer :: (Key -> FilePath -> MeterUpdate -> Annex ()) -> Storer
|
||||
fileStorer a k (FileContent f) m = a k f m
|
||||
fileStorer a k (ByteContent b) m = withTmp k $ \f -> do
|
||||
liftIO $ L.writeFile f b
|
||||
a k f m
|
||||
let f' = fromRawFilePath f
|
||||
liftIO $ L.writeFile f' b
|
||||
a k f' m
|
||||
|
||||
-- A Storer that expects to be provided with a L.ByteString of
|
||||
-- the content to store.
|
||||
|
@ -106,8 +107,8 @@ byteStorer a k c m = withBytes c $ \b -> a k b m
|
|||
fileRetriever :: (FilePath -> Key -> MeterUpdate -> Annex ()) -> Retriever
|
||||
fileRetriever a k m callback = do
|
||||
f <- prepTmp k
|
||||
a f k m
|
||||
pruneTmpWorkDirBefore f (callback . FileContent)
|
||||
a (fromRawFilePath f) k m
|
||||
pruneTmpWorkDirBefore f (callback . FileContent . fromRawFilePath)
|
||||
|
||||
-- A Retriever that generates a lazy ByteString containing the Key's
|
||||
-- content, and passes it to a callback action which will fully consume it
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue