Revert "Delete empty downloaded file when wget fails, to work around reported resume failure."

This reverts commit 98886e3fbf.

Better fix forthcoming
This commit is contained in:
Joey Hess 2013-08-21 18:17:48 -04:00
parent ec3fce7497
commit 0912e752b5
2 changed files with 2 additions and 12 deletions

View file

@ -118,16 +118,8 @@ download' quiet url headers options file =
- downloaded before the resume. -}
curl = go "curl" $ headerparams ++ quietopt "-s" ++
[Params "-f -L -C - -# -o"]
go cmd opts = do
ok <- boolSystem cmd $
options++opts++[File file, File url]
-- wget sometimes leaves behind an empty file on failure;
-- remove this as it sometimes interferes with a re-download
unless ok $ do
size <- catchMaybeIO $ fileSize <$> getFileStatus file
when (size == Just 0) $
removeFile file
return ok
go cmd opts = boolSystem cmd $
options++opts++[File file, File url]
quietopt s
| quiet = [Param s]
| otherwise = []