Fix resuming a download when using curl.

Noticed a bug; when using curl a workaround for its empty file behavior
overwrote the file content, so it never resumed and always started over.
This commit is contained in:
Joey Hess 2018-04-06 16:09:53 -04:00
parent 0f6775f1ff
commit 36e6b8abbf
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 3 additions and 1 deletions

View file

@ -18,6 +18,7 @@ git-annex (6.20180317) UNRELEASED; urgency=medium
stat when run on a directory.
* info: Changed sorting of numcopies stats table, so it's ordered
by the variance from the desired number of copies.
* Fix resuming a download when using curl.
-- Joey Hess <id@joeyh.name> Mon, 19 Mar 2018 23:13:59 -0400

View file

@ -295,7 +295,8 @@ download' quiet url file uo = do
curl = do
-- curl does not create destination file
-- if the url happens to be empty, so pre-create.
writeFile file ""
unlessM (doesFileExist file) $
writeFile file ""
go "curl" $ headerparams ++ quietopt "-sS" ++
[ Param "-f"
, Param "-L"