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

Commit 0e3e6a4

Browse files
committed
delta release logic, and 7.10.2-a
1 parent 84a1e32 commit 0e3e6a4

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

hptool/src/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ main = shakeArgsWith opts flags main'
8282

8383
opts = shakeOptions
8484

85-
hpRelease = hp_7_10_2
85+
hpRelease = hp_7_10_2_a
8686
hpFullName = show $ relVersion hpRelease
8787
srcTarFile = productDir </> hpFullName <.> "tar.gz"
8888

hptool/src/PlatformDB.hs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module PlatformDB
2-
( release,
2+
( release, deltaFrom,
33
incGHC, incGHCLib, incGHCTool, incLib, incTool,
44
notWindows, onlyWindows,
55

@@ -11,6 +11,7 @@ module PlatformDB
1111
isGhc, isWindows, isNotWindows, isLib, isTool
1212
) where
1313

14+
import Data.List (partition)
1415

1516
import Types
1617
import Utils (version)
@@ -19,6 +20,20 @@ import Utils (version)
1920
release :: String -> [Include] -> Release
2021
release vstr incs = Release (HpVersion $ version vstr) incs
2122

23+
-- | Construct list of Includes as a delta to packages in another release
24+
deltaFrom :: Release -> [Include] -> [Include]
25+
deltaFrom base deltas = go (relIncludes base) deltas
26+
where
27+
go [] dIncs = dIncs
28+
go (bInc : bIncs) dIncs =
29+
let (updates, dIncs') = partition (match bInc) dIncs
30+
in merge bInc updates : go bIncs dIncs'
31+
32+
match (_, bPkg) (_, dPkg) = pkgName bPkg == pkgName dPkg
33+
34+
merge bInc [] = bInc
35+
merge _ [updateInc] = updateInc
36+
merge bInc _ = error $ "multiple updates for package " ++ show (snd bInc)
2237

2338
buildInc :: IncludeType -> PackageName -> String -> Include
2439
buildInc inc name vstr = (inc, Package name $ version vstr)

hptool/src/Releases2015.hs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import PlatformDB
44
import Types
55

66
releases2015 :: [Release]
7-
releases2015 = [hp_7_10_2]
7+
releases2015 = [hp_7_10_2, hp_7_10_2_a]
88

99
hp_7_10_2 :: Release
1010
hp_7_10_2 =
@@ -109,3 +109,11 @@ hp_7_10_2 =
109109
, incGHCTool "haddock" "2.16.1"
110110
]
111111

112+
hp_7_10_2_a :: Release
113+
hp_7_10_2_a =
114+
release "7.10.2-a" $ deltaFrom hp_7_10_2
115+
[ incLib "text" "1.2.1.3"
116+
, incLib "fgl" "5.5.2.1"
117+
]
118+
119+

0 commit comments

Comments
 (0)