summaryrefslogtreecommitdiff
path: root/Utility/Url.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-10-16 00:04:26 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-10-16 00:04:26 -0400
commit91366c896d9c9cb4519b451a64ed4d1e0ff52cb3 (patch)
treef9c7073002f68f1b53ba62890794474301a7253a /Utility/Url.hs
parent52c8244219dd90102818282b8b09186f2ce93a0f (diff)
clean Annex stuff out of Utility/
Diffstat (limited to 'Utility/Url.hs')
-rw-r--r--Utility/Url.hs12
1 files changed, 4 insertions, 8 deletions
diff --git a/Utility/Url.hs b/Utility/Url.hs
index 6ddeecc14..b5f5b78c0 100644
--- a/Utility/Url.hs
+++ b/Utility/Url.hs
@@ -12,13 +12,10 @@ module Utility.Url (
) where
import Control.Applicative
-import Control.Monad.State (liftIO)
import qualified Network.Browser as Browser
import Network.HTTP
import Network.URI
-import Types
-import Messages
import Utility.SafeCommand
import Utility
@@ -38,13 +35,12 @@ exists url =
{- Used to download large files, such as the contents of keys.
- Uses wget or curl program for its progress bar. (Wget has a better one,
- so is preferred.) -}
-download :: URLString -> FilePath -> Annex Bool
+download :: URLString -> FilePath -> IO Bool
download url file = do
- showOutput -- make way for program's progress bar
- e <- liftIO $ inPath "wget"
+ e <- inPath "wget"
if e
then
- liftIO $ boolSystem "wget"
+ boolSystem "wget"
[Params "-c -O", File file, File url]
else
-- Uses the -# progress display, because the normal
@@ -52,7 +48,7 @@ download url file = do
-- the remainder to download as the whole file,
-- and not indicating how much percent was
-- downloaded before the resume.
- liftIO $ boolSystem "curl"
+ boolSystem "curl"
[Params "-L -C - -# -o", File file, File url]
{- Downloads a small file. -}