@@ -5,7 +5,7 @@ module Stuff.Verify
55 where
66
77
8−import Control.Monad (liftM2, liftM3, liftM4)
8+import Control.Monad (liftM2, liftM4)
99import Data.Binary
1010import Data.Map (Map)
1111
@@ -62,15 +62,15 @@ data MiniSummary =
6262
6363
6464data ProjectDeps
65− = App (Map Name Version) (Map Name Version) (Map Name Version)
65+ = App (Map Name Version) (Map Name Version) (Map Name Version) (Map Name Version)
6666 | Pkg (Map Name Con.Constraint) (Map Name Con.Constraint)
6767
6868
6969getDeps :: Project.Project -> ProjectDeps
7070getDeps project =
7171 case project of
72− Project.App (Project.AppInfo _ _ direct test trans) ->
73− App direct test trans
72+ Project.App (Project.AppInfo _ _ depsDirect depsTrans testDirect testTrans) ->
73+ App depsDirect depsTrans testDirect testTrans
7474
7575 Project.Pkg (Project.PkgInfo _ _ _ _ _ direct test _) ->
7676 Pkg direct test
@@ -79,21 +79,18 @@ getDeps project =
7979isValidMiniSummary :: ProjectDeps -> Project.Project -> Bool
8080isValidMiniSummary deps project =
8181 case deps of
82− App cachedDirect cachedTest cachedTrans ->
82+ App a b c d ->
8383 case project of
8484 Project.Pkg _ ->
8585 False
8686
87− Project.App (Project.AppInfo _ _ direct test trans) ->
88− cachedDirect == direct
89− && cachedTest == test
90− && cachedTrans == trans
87+ Project.App (Project.AppInfo _ _ a2 b2 c2 d2) ->
88+ a == a2 && b == b2 && c == c2 && d == d2
9189
92− Pkg cachedDirect cachedTest ->
90+ Pkg a b ->
9391 case project of
94− Project.Pkg (Project.PkgInfo _ _ _ _ _ direct test _) ->
95− cachedDirect == direct
96− && cachedTest == test
92+ Project.Pkg (Project.PkgInfo _ _ _ _ _ a2 b2 _) ->
93+ a == a2 && b == b2
9794
9895 Project.App _ ->
9996 False
@@ -112,12 +109,12 @@ instance Binary MiniSummary where
112109instance Binary ProjectDeps where
113110 put deps =
114111 case deps of
115− App a b c -> putWord8 0 >> put a >> put b >> put c
116− Pkg a b -> putWord8 1 >> put a >> put b
112+ App a b c d -> putWord8 0 >> put a >> put b >> put c >> put d
113+ Pkg a b -> putWord8 1 >> put a >> put b
117114
118115 get =
119116 do n <- getWord8
120117 case n of
121− 0 -> liftM3 App get get get
118+ 0 -> liftM4 App get get get get
122119 1 -> liftM2 Pkg get get
123120 _ -> error "binary encoding of ProjectDeps was corrupted"