summaryrefslogtreecommitdiff
path: root/Remote/Directory.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-03-04 03:36:39 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-03-04 03:36:39 -0400
commit7ba79cfb8c5c2a0fcb1472ab67bb777999e8e88a (patch)
tree361d18e7f4f42e811f2d48473012f8c3daaec0ff /Remote/Directory.hs
parent46383140015fb607ba7d9c7bf5a3c2c435dfb548 (diff)
thread through original key to retrieveEnctypted
Allows showing progress bar for this last case of the directory special remote.
Diffstat (limited to 'Remote/Directory.hs')
-rw-r--r--Remote/Directory.hs13
1 files changed, 7 insertions, 6 deletions
diff --git a/Remote/Directory.hs b/Remote/Directory.hs
index 40e6dc72d..e23891e5a 100644
--- a/Remote/Directory.hs
+++ b/Remote/Directory.hs
@@ -237,12 +237,13 @@ retrieve d chunksize k f = metered k $ \meterupdate ->
(L.concat <$> mapM L.readFile files)
return True
-retrieveEncrypted :: FilePath -> ChunkSize -> (Cipher, Key) -> FilePath -> Annex Bool
-retrieveEncrypted d chunksize (cipher, enck) f =
- liftIO $ withStoredFiles chunksize d enck $ \files -> catchBoolIO $ do
- withDecryptedContent cipher (L.concat <$> mapM L.readFile files) $
- L.writeFile f
- return True
+retrieveEncrypted :: FilePath -> ChunkSize -> (Cipher, Key) -> Key -> FilePath -> Annex Bool
+retrieveEncrypted d chunksize (cipher, enck) k f = metered k $ \meterupdate ->
+ liftIO $ withStoredFiles chunksize d enck $ \files ->
+ catchBoolIO $ do
+ withDecryptedContent cipher (L.concat <$> mapM L.readFile files) $
+ meteredWriteFile meterupdate f
+ return True
retrieveCheap :: FilePath -> ChunkSize -> Key -> FilePath -> Annex Bool
retrieveCheap _ (Just _) _ _ = return False -- no cheap retrieval for chunks