summaryrefslogtreecommitdiff
path: root/Remote/BitTorrent.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2015-04-03 16:48:30 -0400
committerJoey Hess <joeyh@joeyh.name>2015-04-03 16:48:30 -0400
commit20fb91a7ad9a6163a277d6d6a383da0bf98b5641 (patch)
treeae65450df2b7217c0d16e58f7282e8a567a6dafa /Remote/BitTorrent.hs
parentc2c901a6e4c62355c49339d1794f39fbba8c0b50 (diff)
WIP on making --quiet silence progress, and infra for concurrent progress bars
Diffstat (limited to 'Remote/BitTorrent.hs')
-rw-r--r--Remote/BitTorrent.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/Remote/BitTorrent.hs b/Remote/BitTorrent.hs
index fe49d023af..27844c2626 100644
--- a/Remote/BitTorrent.hs
+++ b/Remote/BitTorrent.hs
@@ -19,6 +19,7 @@ import Logs.Web
import Types.UrlContents
import Types.CleanupActions
import Types.Key
+import Messages.Progress
import Utility.Metered
import Utility.Tmp
import Backend.URL
@@ -291,11 +292,12 @@ runAria :: [CommandParam] -> Annex Bool
runAria ps = liftIO . boolSystem "aria2c" =<< ariaParams ps
-- Parse aria output to find "(n%)" and update the progress meter
--- with it. The output is also output to stdout.
+-- with it.
ariaProgress :: Maybe Integer -> MeterUpdate -> [CommandParam] -> Annex Bool
ariaProgress Nothing _ ps = runAria ps
-ariaProgress (Just sz) meter ps =
- liftIO . commandMeter (parseAriaProgress sz) meter "aria2c"
+ariaProgress (Just sz) meter ps = do
+ h <- mkProgressHandler meter
+ liftIO . commandMeter (parseAriaProgress sz) h "aria2c"
=<< ariaParams ps
parseAriaProgress :: Integer -> ProgressParser