run curl when configured to do it at runtime, even if not available at build time
This commit is contained in:
parent
db9524bfcc
commit
c8f2d302dc
1 changed files with 2 additions and 5 deletions
|
@ -34,7 +34,6 @@ module Utility.Url (
|
||||||
|
|
||||||
import Common
|
import Common
|
||||||
import Utility.Metered
|
import Utility.Metered
|
||||||
import qualified BuildInfo
|
|
||||||
|
|
||||||
import Network.URI
|
import Network.URI
|
||||||
import Network.HTTP.Types
|
import Network.HTTP.Types
|
||||||
|
@ -173,8 +172,7 @@ getUrlInfo url uo = case parseURIRelaxed url of
|
||||||
sz <- getFileSize' f stat
|
sz <- getFileSize' f stat
|
||||||
found (Just sz) Nothing
|
found (Just sz) Nothing
|
||||||
Nothing -> dne
|
Nothing -> dne
|
||||||
| BuildInfo.curl -> existscurl u
|
| otherwise -> existscurl u
|
||||||
| otherwise -> dne
|
|
||||||
Nothing -> dne
|
Nothing -> dne
|
||||||
where
|
where
|
||||||
dne = return $ UrlInfo False Nothing Nothing
|
dne = return $ UrlInfo False Nothing Nothing
|
||||||
|
@ -271,8 +269,7 @@ download meterupdate url file uo = go `catchNonAsync` (const $ return False)
|
||||||
withMeteredFile src meterupdate $
|
withMeteredFile src meterupdate $
|
||||||
L.writeFile file
|
L.writeFile file
|
||||||
return True
|
return True
|
||||||
| BuildInfo.curl -> downloadcurl
|
| otherwise -> downloadcurl
|
||||||
| otherwise -> return False
|
|
||||||
Nothing -> return False
|
Nothing -> return False
|
||||||
|
|
||||||
downloadconduit req = catchMaybeIO (getFileSize file) >>= \case
|
downloadconduit req = catchMaybeIO (getFileSize file) >>= \case
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue