summaryrefslogtreecommitdiff
path: root/Backend
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-14 20:05:04 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-14 20:05:04 -0400
commit4c3ad80f320d3c4cccc3e41e4f2364155bae22a1 (patch)
tree5c09b65168929801291f2d5f84250a88e53d5394 /Backend
parentb8ba60428a0b4c077482560757e830e9ba02a823 (diff)
bugfix
Diffstat (limited to 'Backend')
-rw-r--r--Backend/Url.hs11
1 files changed, 7 insertions, 4 deletions
diff --git a/Backend/Url.hs b/Backend/Url.hs
index 325a7e217..e23767208 100644
--- a/Backend/Url.hs
+++ b/Backend/Url.hs
@@ -3,7 +3,8 @@
module Backend.Url (backend) where
-import Control.Monad.State
+import Control.Monad.State (liftIO)
+import Data.String.Utils
import System.Cmd
import System.Exit
import BackendTypes
@@ -30,9 +31,11 @@ dummyOk :: Key -> Annex Bool
dummyOk url = return True
downloadUrl :: Key -> FilePath -> Annex Bool
-downloadUrl url file = do
- liftIO $ putStrLn $ "download: " ++ (show url)
- result <- liftIO $ rawSystem "curl" ["-#", "-o", file, (show url)]
+downloadUrl key file = do
+ liftIO $ putStrLn $ "download: " ++ url
+ result <- liftIO $ rawSystem "curl" ["-#", "-o", file, url]
if (result == ExitSuccess)
then return True
else return False
+ where
+ url = join ":" $ drop 1 $ split ":" $ show key