refactor sinkResponseFile and add downloadC

Remote.S3 and Remote.Helper.Http both had similar code to sink a
http-conduit Response to a file; refactor out sinkResponseFile.

downloadC downloads an url to a file using http-conduit, and supports
resuming. Falls back to curl to handle urls that http-conduit does not
support. This is not used yet, but the goal is to replace download with
it.

git-annex.cabal: conduit-extra was not actually used for a long time,
remove the dep. conduit moves into the main dependency list, but since
http-conduit was already in there, and it depends on conduit, that's not
really adding a new build dep.

This commit was supported by the NSF-funded DataLad project.
This commit is contained in:
Joey Hess 2018-04-06 15:58:16 -04:00
parent 0e8564201e
commit 0f6775f1ff
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
6 changed files with 138 additions and 35 deletions

View file

@ -343,6 +343,7 @@ Executable git-annex
http-client,
http-types (>= 0.7),
http-conduit (>= 2.0),
conduit,
time,
old-locale,
esqueleto,
@ -409,7 +410,7 @@ Executable git-annex
Other-Modules: Utility.Touch.Old
if flag(S3)
Build-Depends: conduit, conduit-extra, aws (>= 0.9.2)
Build-Depends: aws (>= 0.9.2)
CPP-Options: -DWITH_S3
Other-Modules: Remote.S3