diff options
Diffstat (limited to 'Remote/Helper/ChunkedEncryptable.hs')
-rw-r--r-- | Remote/Helper/ChunkedEncryptable.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Remote/Helper/ChunkedEncryptable.hs b/Remote/Helper/ChunkedEncryptable.hs index 2a844212b..1267f5b59 100644 --- a/Remote/Helper/ChunkedEncryptable.hs +++ b/Remote/Helper/ChunkedEncryptable.hs @@ -14,6 +14,7 @@ module Remote.Helper.ChunkedEncryptable ( simplyPrepare, ContentSource, checkPrepare, + resourcePrepare, fileStorer, byteStorer, fileRetriever, @@ -49,6 +50,11 @@ checkPrepare checker helper k a = ifM (checker k) , a Nothing ) +-- Use to acquire a resource when preparing a helper. +resourcePrepare :: (Key -> (r -> Annex Bool) -> Annex Bool) -> (r -> helper) -> Preparer helper +resourcePrepare withr helper k a = withr k $ \r -> + a (Just (helper r)) + -- A Storer that expects to be provided with a file containing -- the content of the key to store. fileStorer :: (Key -> FilePath -> MeterUpdate -> Annex Bool) -> Storer |