summaryrefslogtreecommitdiff
path: root/Remote/Hook.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-04-11 17:15:45 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-04-11 17:32:31 -0400
commit67524c3a41a2c0b5e8c34bcbfde737ca50fc191b (patch)
tree2d6e8c0fcf36efe7274c9bc1f83c85635412be59 /Remote/Hook.hs
parent90f10c58ba491a17d1b59e91d8c730f80cd25bce (diff)
connect existing meters to the transfer log for downloads
Most remotes have meters in their implementations of retrieveKeyFile already. Simply hooking these up to the transfer log makes that information available. Easy peasy. This is particularly valuable information for encrypted remotes, which otherwise bypass the assistant's polling of temp files, and so don't have good progress bars yet. Still some work to do here (see progressbars.mdwn changes), but this is entirely an improvement from the lack of progress bars for encrypted downloads.
Diffstat (limited to 'Remote/Hook.hs')
-rw-r--r--Remote/Hook.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Remote/Hook.hs b/Remote/Hook.hs
index 46ee8000f..9a4849b6e 100644
--- a/Remote/Hook.hs
+++ b/Remote/Hook.hs
@@ -116,14 +116,14 @@ storeEncrypted h gpgOpts (cipher, enck) k _p = withTmp enck $ \tmp ->
readBytes $ L.writeFile tmp
runHook h "store" enck (Just tmp) $ return True
-retrieve :: String -> Key -> AssociatedFile -> FilePath -> Annex Bool
-retrieve h k _f d = runHook h "retrieve" k (Just d) $ return True
+retrieve :: String -> Key -> AssociatedFile -> FilePath -> MeterUpdate -> Annex Bool
+retrieve h k _f d _p = runHook h "retrieve" k (Just d) $ return True
retrieveCheap :: String -> Key -> FilePath -> Annex Bool
retrieveCheap _ _ _ = return False
-retrieveEncrypted :: String -> (Cipher, Key) -> Key -> FilePath -> Annex Bool
-retrieveEncrypted h (cipher, enck) _ f = withTmp enck $ \tmp ->
+retrieveEncrypted :: String -> (Cipher, Key) -> Key -> FilePath -> MeterUpdate -> Annex Bool
+retrieveEncrypted h (cipher, enck) _ f _p = withTmp enck $ \tmp ->
runHook h "retrieve" enck (Just tmp) $ liftIO $ catchBoolIO $ do
decrypt cipher (feedFile tmp) $
readBytes $ L.writeFile f