mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-24 09:51:57 +01:00
Update Cabal version, be more resilient about generating Cabal files
This commit is contained in:
parent
b2170578ae
commit
45bac17582
@ -266,12 +266,19 @@ createView viewName modifyCabal src sink = withSystemTempDirectory "createview"
|
|||||||
case msrc of
|
case msrc of
|
||||||
Nothing -> return mempty
|
Nothing -> return mempty
|
||||||
Just src -> do
|
Just src -> do
|
||||||
|
-- FIXME only create a new file if the old one doesn't exist?
|
||||||
orig <- src $$ sinkLazy
|
orig <- src $$ sinkLazy
|
||||||
new <-
|
new <-
|
||||||
case parsePackageDescription $ unpack $ decodeUtf8 orig of
|
case parsePackageDescription $ unpack $ decodeUtf8 orig of
|
||||||
ParseOk _ gpd -> do
|
ParseOk _ gpd -> do
|
||||||
gpd' <- modifyCabal name version time gpd
|
gpd' <- modifyCabal name version time gpd
|
||||||
return $ encodeUtf8 $ pack $ showGenericPackageDescription gpd'
|
let str = showGenericPackageDescription gpd'
|
||||||
|
-- sanity check
|
||||||
|
case parsePackageDescription str of
|
||||||
|
ParseOk _ _ -> return $ encodeUtf8 $ pack str
|
||||||
|
x -> do
|
||||||
|
$logError $ "Created cabal file that could not be parsed: " ++ tshow (x, str)
|
||||||
|
return orig
|
||||||
_ -> return orig
|
_ -> return orig
|
||||||
sourceLazy new $$ storeWrite (HackageViewCabal viewName name version)
|
sourceLazy new $$ storeWrite (HackageViewCabal viewName name version)
|
||||||
let fp = fpFromString dir </> relfp
|
let fp = fpFromString dir </> relfp
|
||||||
|
|||||||
@ -111,7 +111,8 @@ library
|
|||||||
, esqueleto
|
, esqueleto
|
||||||
, xml-conduit
|
, xml-conduit
|
||||||
, html-conduit
|
, html-conduit
|
||||||
, Cabal
|
-- Avoid https://github.com/haskell/cabal/issues/1202
|
||||||
|
, Cabal >= 1.18
|
||||||
, lifted-base
|
, lifted-base
|
||||||
, mono-traversable
|
, mono-traversable
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user