From d660e2443b99817a33127443e5d7314c99c291fc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 3 Apr 2015 16:48:30 -0400 Subject: WIP on making --quiet silence progress, and infra for concurrent progress bars --- Remote/BitTorrent.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Remote/BitTorrent.hs') 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 -- cgit v1.2.3