mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-12 04:08:29 +01:00
cabal.config links should always be http; cabal doesn't support https. #83
This commit is contained in:
parent
9112ac4440
commit
5c3e4adf10
@ -130,22 +130,29 @@ getStackageCabalConfigR slug = do
|
||||
|
||||
headerGlobal render = yield $ Chunk $
|
||||
toBuilder (asText "-- Stackage snapshot from: ") ++
|
||||
toBuilder (render $ SnapshotR slug StackageHomeR) ++
|
||||
toBuilder snapshotUrl ++
|
||||
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 slug) ++
|
||||
toBuilder ':' ++
|
||||
toBuilder (render $ SnapshotR slug StackageHomeR) ++
|
||||
toBuilder snapshotUrl ++
|
||||
toBuilder '\n'
|
||||
|
||||
headerLocal render = yield $ Chunk $
|
||||
toBuilder (asText "-- Stackage snapshot from: ") ++
|
||||
toBuilder (render $ SnapshotR slug StackageHomeR) ++
|
||||
toBuilder snapshotUrl ++
|
||||
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 slug) ++
|
||||
toBuilder ':' ++
|
||||
toBuilder (render $ SnapshotR slug StackageHomeR) ++
|
||||
toBuilder snapshotUrl ++
|
||||
toBuilder '\n'
|
||||
|
||||
snapshotUrl = asHttp $ render $ SnapshotR slug StackageHomeR
|
||||
|
||||
asHttp (stripPrefix "http://" -> Just s) = "http://" <> s
|
||||
asHttp (stripPrefix "https://" -> Just s) = "http://" <> s
|
||||
asHttp (stripPrefix "//" -> Just s) = "http://" <> s
|
||||
asHttp s = error $ "Unexpected url prefix: " <> unpack s
|
||||
|
||||
constraint p
|
||||
| Just True <- packageCore p = toBuilder $ asText " installed"
|
||||
| otherwise = toBuilder (asText " ==") ++
|
||||
|
||||
Loading…
Reference in New Issue
Block a user