mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-19 07:31:55 +01:00
Fix Hoogle database download
This commit is contained in:
parent
59fac14f73
commit
c7b82f38d0
@ -107,7 +107,6 @@ hoogleUrl :: SnapName -> Text
|
|||||||
hoogleUrl n = concat
|
hoogleUrl n = concat
|
||||||
[ "https://s3.amazonaws.com/haddock.stackage.org/"
|
[ "https://s3.amazonaws.com/haddock.stackage.org/"
|
||||||
, hoogleKey n
|
, hoogleKey n
|
||||||
, ".gz"
|
|
||||||
]
|
]
|
||||||
|
|
||||||
getHoogleDB :: Bool -- ^ print exceptions?
|
getHoogleDB :: Bool -- ^ print exceptions?
|
||||||
@ -120,11 +119,15 @@ getHoogleDB toPrint man name = do
|
|||||||
then return $ Just fp
|
then return $ Just fp
|
||||||
else do
|
else do
|
||||||
req' <- parseUrl $ unpack $ hoogleUrl name
|
req' <- parseUrl $ unpack $ hoogleUrl name
|
||||||
let req = req' { checkStatus = \_ _ _ -> Nothing }
|
let req = req'
|
||||||
|
{ checkStatus = \_ _ _ -> Nothing
|
||||||
|
, decompress = const False
|
||||||
|
}
|
||||||
withResponse req man $ \res -> if responseStatus res == status200
|
withResponse req man $ \res -> if responseStatus res == status200
|
||||||
then do
|
then do
|
||||||
createTree $ parent fptmp
|
createTree $ parent fptmp
|
||||||
runResourceT $ bodyReaderSource (responseBody res)
|
runResourceT $ bodyReaderSource (responseBody res)
|
||||||
|
$= ungzip
|
||||||
$$ sinkFile fptmp
|
$$ sinkFile fptmp
|
||||||
rename fptmp fp
|
rename fptmp fp
|
||||||
return $ Just fp
|
return $ Just fp
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user