From aa0882691bb2aa64fb13f0df85be0469fd33d98d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 2 Jan 2012 14:20:20 -0400 Subject: Added remote.name.annex-web-options configuration setting, which can be used to provide parameters to whichever of wget or curl git-annex uses (depends on which is available, but most of their important options suitable for use here are the same). --- Remote/Git.hs | 4 +--- Remote/Web.hs | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'Remote') diff --git a/Remote/Git.hs b/Remote/Git.hs index b9d9966a4..da81241eb 100644 --- a/Remote/Git.hs +++ b/Remote/Git.hs @@ -209,10 +209,8 @@ copyFromRemote r key file loc <- liftIO $ gitAnnexLocation key r rsyncOrCopyFile params loc file | Git.repoIsSsh r = rsyncHelper =<< rsyncParamsRemote r True key file - | Git.repoIsHttp r = liftIO $ downloadurls $ keyUrls r key + | Git.repoIsHttp r = Annex.Content.downloadUrl (keyUrls r key) file | otherwise = error "copying from non-ssh, non-http repo not supported" - where - downloadurls us = untilTrue us $ \u -> Url.download u file {- Tries to copy a key's content to a remote's annex. -} copyToRemote :: Git.Repo -> Key -> Annex Bool diff --git a/Remote/Web.hs b/Remote/Web.hs index 93e5770f0..4d6348e59 100644 --- a/Remote/Web.hs +++ b/Remote/Web.hs @@ -11,6 +11,7 @@ import Common.Annex import Types.Remote import qualified Git import qualified Git.Construct +import Annex.Content import Config import Logs.Web import qualified Utility.Url as Url @@ -55,7 +56,7 @@ downloadKey key file = get =<< getUrls key return False get urls = do showOutput -- make way for download progress bar - liftIO $ anyM (`Url.download` file) urls + downloadUrl urls file uploadKey :: Key -> Annex Bool uploadKey _ = do -- cgit v1.2.3