diff options
-rw-r--r-- | Utility/Url.hs | 7 | ||||
-rw-r--r-- | doc/bugs/get_fails_for_file:__47____47___web_remotes_if_the_file_is_empty.mdwn | 5 |
2 files changed, 10 insertions, 2 deletions
diff --git a/Utility/Url.hs b/Utility/Url.hs index da7863091..14a6f8f6f 100644 --- a/Utility/Url.hs +++ b/Utility/Url.hs @@ -17,6 +17,7 @@ module Utility.Url ( import Common import Network.URI +import Utility.CopyFile type URLString = String @@ -71,11 +72,13 @@ exists url headers = case parseURI url of - would not be appropriate to test at configure time and build support - for only one in. - - - Curl is always used for file:// urls, as wget does not support them. + - For file:// urls, neither program works well, so we just copy. -} download :: URLString -> Headers -> [CommandParam] -> FilePath -> IO Bool download url headers options file - | "file://" `isPrefixOf` url = curl + | "file://" `isPrefixOf` url = + let f = drop (length "file://") url + in copyFileExternal f file | otherwise = ifM (inPath "wget") (wget , curl) where headerparams = map (\h -> Param $ "--header=" ++ h) headers diff --git a/doc/bugs/get_fails_for_file:__47____47___web_remotes_if_the_file_is_empty.mdwn b/doc/bugs/get_fails_for_file:__47____47___web_remotes_if_the_file_is_empty.mdwn index 84b107c31..bb943fa86 100644 --- a/doc/bugs/get_fails_for_file:__47____47___web_remotes_if_the_file_is_empty.mdwn +++ b/doc/bugs/get_fails_for_file:__47____47___web_remotes_if_the_file_is_empty.mdwn @@ -19,3 +19,8 @@ Debian sid/experimental default repository version: 3 supported repository versions: 3 4 upgrade supported from repository versions: 0 1 2 + +> Seems that curl doesn't write the file it was asked to +> output to in this case. Crazy. Does not affect empty +> http urls. Switched to using just cp for file:// +> [[done]] --[[Joey]] |