diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-04-03 16:48:30 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-04-03 16:48:30 -0400 |
commit | d660e2443b99817a33127443e5d7314c99c291fc (patch) | |
tree | 4ae14e3f1d2c58c4ffd075ccee9d6b59caa0665f /Remote/BitTorrent.hs | |
parent | ff10867b8d11c734bc971f6fa4e86be94c15a7b1 (diff) |
WIP on making --quiet silence progress, and infra for concurrent progress bars
Diffstat (limited to 'Remote/BitTorrent.hs')
-rw-r--r-- | Remote/BitTorrent.hs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Remote/BitTorrent.hs b/Remote/BitTorrent.hs index fe49d023a..27844c262 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 |