Skip to content
This repository was archived by the owner on Feb 3, 2022. It is now read-only.

Commit c0c5ace

Browse files
U-CIQDEV\gbazermanU-CIQDEV\gbazerman
authored andcommitted
generate platform freeze config
1 parent d1b6a49 commit c0c5ace

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

hptool/src/Website.hs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,23 @@ websiteRules templateSite = do
2323
websiteDir %/> \dst -> do
2424
bcCtx <- buildConfigContext
2525
let rlsCtx = releasesCtx
26-
ctx = ctxConcat [rlsCtx, historyCtx, bcCtx, errorCtx]
26+
ctx = ctxConcat [rlsCtx, historyCtx, bcCtx, currentPlatformCtx, errorCtx]
2727
copyExpandedDir ctx templateSite dst
2828

29+
currentPlatformCtx :: Monad m => MuContext m
30+
currentPlatformCtx = mkStrContext ctx
31+
where
32+
ctx "freezeConfig" = mapListStrContext go freezeIncludes
33+
ctx _ = MuNothing
34+
35+
go x "name" = MuVariable $ pkgName x
36+
go x "version" = MuVariable . showVersion $ pkgVersion x
37+
go _ _ = MuNothing
38+
39+
freezeIncludes = map snd . filter filt . allRelIncludes $ head (reverse releases)
40+
filt x = not (fst x `elem` [IncGHC, IncGHCLib, IncGHCTool, IncTool])
41+
42+
2943
fileCtx :: (Monad m) => FileInfo -> MuContext m
3044
fileCtx (dist, url, mHash) = mkStrContext ctx
3145
where
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-- Config file for Haskell Platform {{#current}}{{version}}, {{month}} {{year}}{{/current}}
2+
3+
constraints: {{#freezeConfig}} {{^first}}
4+
{{/first}}{{name}} == {{version}}{{^last}},{{/last}}
5+
{{/freezeConfig}}

0 commit comments

Comments
 (0)