aboutsummaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-04-04 15:01:00 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-04-04 15:01:00 -0400
commitb855580614852c7558fb2aad387609d15c4b0c6b (patch)
tree9f523cdb70e17cfa3d8bdb6a5d51364557572869 /Annex
parent7cd9433dab89e1e007cef783d8b18e5eeac987f1 (diff)
parent8815f95d1ad0413ca35e6873f4b7b272bac629db (diff)
Merge branch 'concurrentprogress'
Diffstat (limited to 'Annex')
-rw-r--r--Annex/Content.hs16
1 files changed, 11 insertions, 5 deletions
diff --git a/Annex/Content.hs b/Annex/Content.hs
index f91c1e72a..310c43daf 100644
--- a/Annex/Content.hs
+++ b/Annex/Content.hs
@@ -57,6 +57,7 @@ import Annex.Link
import Annex.Content.Direct
import Annex.ReplaceFile
import Utility.LockFile
+import Messages.Progress
{- Checks if a given key's content is currently present. -}
inAnnex :: Key -> Annex Bool
@@ -555,12 +556,17 @@ saveState nocommit = doSideAction $ do
downloadUrl :: [Url.URLString] -> FilePath -> Annex Bool
downloadUrl urls file = go =<< annexWebDownloadCommand <$> Annex.getGitConfig
where
- go Nothing = Url.withUrlOptions $ \uo ->
- anyM (\u -> Url.download u file uo) urls
- go (Just basecmd) = liftIO $ anyM (downloadcmd basecmd) urls
+ go Nothing = do
+ a <- ifM commandProgressDisabled
+ ( return Url.downloadQuiet
+ , return Url.download
+ )
+ Url.withUrlOptions $ \uo ->
+ anyM (\u -> a u file uo) urls
+ go (Just basecmd) = anyM (downloadcmd basecmd) urls
downloadcmd basecmd url =
- boolSystem "sh" [Param "-c", Param $ gencmd url basecmd]
- <&&> doesFileExist file
+ progressCommand "sh" [Param "-c", Param $ gencmd url basecmd]
+ <&&> liftIO (doesFileExist file)
gencmd url = massReplace
[ ("%file", shellEscape file)
, ("%url", shellEscape url)