Display progress meter in -J mode when downloading from the web.

Including in addurl, and get --from web, but also in S3 and External
special remotes when a web url is known for content in those remotes.
This commit is contained in:
Joey Hess 2015-11-16 21:00:54 -04:00
parent 1244eb3770
commit e97fce35a6
Failed to extract signature
9 changed files with 36 additions and 30 deletions

View file

@ -29,8 +29,8 @@ import Data.Quantity
{- Shows a progress meter while performing a transfer of a key.
- The action is passed a callback to use to update the meter. -}
metered :: Maybe MeterUpdate -> Key -> AssociatedFile -> (MeterUpdate -> Annex a) -> Annex a
metered combinemeterupdate key _af a = case keySize key of
metered :: Maybe MeterUpdate -> Key -> (MeterUpdate -> Annex a) -> Annex a
metered combinemeterupdate key a = case keySize key of
Nothing -> nometer
Just size -> withOutputType (go $ fromInteger size)
where
@ -66,10 +66,10 @@ metered combinemeterupdate key _af a = case keySize key of
{- Use when the progress meter is only desired for concurrent
- output; as when a command's own progress output is preferred. -}
concurrentMetered :: Maybe MeterUpdate -> Key -> AssociatedFile -> (MeterUpdate -> Annex a) -> Annex a
concurrentMetered combinemeterupdate key af a = withOutputType go
concurrentMetered :: Maybe MeterUpdate -> Key -> (MeterUpdate -> Annex a) -> Annex a
concurrentMetered combinemeterupdate key a = withOutputType go
where
go (ConcurrentOutput _) = metered combinemeterupdate key af a
go (ConcurrentOutput _) = metered combinemeterupdate key a
go _ = a (fromMaybe (const noop) combinemeterupdate)
{- Progress dots. -}