Merge pull request #105 from fpco/simpler-sandbox-fix

Quick fix to allow old versions of stackage-sandbox to continue working
This commit is contained in:
Michael Snoyman 2015-06-02 05:57:52 +03:00
commit 64548ce031

View File

@ -55,7 +55,7 @@ getStackageCabalConfigR name = do
headerGlobal render = yield $ Chunk $
toBuilder (asText "-- Stackage snapshot from: ") ++
toBuilder (snapshotUrl render) ++
toBuilder (oldSnapshotUrl render) ++
toBuilder (asText "\n-- Please place these contents in your global cabal config file.\n-- To only use tested packages, uncomment the following line\n-- and comment out other remote-repo lines:\n-- remote-repo: stackage-") ++
toBuilder (toPathPiece name) ++
toBuilder ':' ++
@ -64,13 +64,14 @@ getStackageCabalConfigR name = do
headerLocal render = yield $ Chunk $
toBuilder (asText "-- Stackage snapshot from: ") ++
toBuilder (snapshotUrl render) ++
toBuilder (oldSnapshotUrl render) ++
toBuilder (asText "\n-- Please place this file next to your .cabal file as cabal.config\n-- To only use tested packages, uncomment the following line:\n-- remote-repo: stackage-") ++
toBuilder (toPathPiece name) ++
toBuilder ':' ++
toBuilder (snapshotUrl render) ++
toBuilder '\n'
oldSnapshotUrl render = asHttp $ render $ OldSnapshotR (toPathPiece name) []
snapshotUrl render = asHttp $ render $ SnapshotR name StackageHomeR
asHttp (stripPrefix "http://" -> Just s) = "http://" <> s