diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-05-05 14:05:02 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-05-05 14:05:02 -0400 |
commit | 4315fd674b0e9163f0026d8d164f03be53124b9f (patch) | |
tree | 5af6cc2b091d8b6f8396ac8f169c0e8cca3b08c2 /Utility | |
parent | 37705c7157dd2190fee7da528024211b084412c0 (diff) |
Support checking ftp urls for file presence.
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/Url.hs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Utility/Url.hs b/Utility/Url.hs index 9c5d6a708..1d34b558f 100644 --- a/Utility/Url.hs +++ b/Utility/Url.hs @@ -123,10 +123,14 @@ getUrlInfo url uo = case parseURIRelaxed url of | Build.SysConfig.curl -> do output <- catchDefaultIO "" $ readProcess "curl" $ toCommand curlparams + let len = extractlencurl output + let good = found len Nothing case lastMaybe (lines output) of - Just ('2':_:_) -> found - (extractlencurl output) - Nothing + Just ('2':_:_) -> good + -- don't try to parse ftp status + -- codes; if curl got a length, + -- it's good + _ | "ftp" `isInfixOf` uriScheme u && isJust len -> good _ -> dne | otherwise -> dne Nothing -> dne |