@@ -5,7 +5,7 @@ module Stuff.Verify
8−import Control.Monad (liftM2, liftM3, liftM4)
8+import Control.Monad (liftM2, liftM4)
9import Data.Binary
9import Data.Binary
10import Data.Map (Map)
10import Data.Map (Map)
@@ -62,15 +62,15 @@ data MiniSummary =
64data ProjectDeps
64data 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)
66 | Pkg (Map Name Con.Constraint) (Map Name Con.Constraint)
66 | Pkg (Map Name Con.Constraint) (Map Name Con.Constraint)
69getDeps :: Project.Project -> ProjectDeps
69getDeps :: Project.Project -> ProjectDeps
70getDeps project =
70getDeps project =
71 case project of
71 case project of
72− Project.App (Project.AppInfo _ _ direct test trans) ->
72+ Project.App (Project.AppInfo _ _ depsDirect depsTrans testDirect testTrans) ->
73− App direct test trans
73+ App depsDirect depsTrans testDirect testTrans
75 Project.Pkg (Project.PkgInfo _ _ _ _ _ direct test _) ->
75 Project.Pkg (Project.PkgInfo _ _ _ _ _ direct test _) ->
76 Pkg direct test
76 Pkg direct test
@@ -79,21 +79,18 @@ getDeps project =
79isValidMiniSummary :: ProjectDeps -> Project.Project -> Bool
79isValidMiniSummary :: ProjectDeps -> Project.Project -> Bool
80isValidMiniSummary deps project =
80isValidMiniSummary deps project =
81 case deps of
81 case deps of
82− App cachedDirect cachedTest cachedTrans ->
82+ App a b c d ->
83 case project of
83 case project of
84 Project.Pkg _ ->
84 Project.Pkg _ ->
87− Project.App (Project.AppInfo _ _ direct test trans) ->
87+ Project.App (Project.AppInfo _ _ a2 b2 c2 d2) ->
88− cachedDirect == direct
88+ a == a2 && b == b2 && c == c2 && d == d2
89− && cachedTest == test
90− && cachedTrans == trans
92− Pkg cachedDirect cachedTest ->
90+ Pkg a b ->
93 case project of
91 case project of
94− Project.Pkg (Project.PkgInfo _ _ _ _ _ direct test _) ->
92+ Project.Pkg (Project.PkgInfo _ _ _ _ _ a2 b2 _) ->
95− cachedDirect == direct
93+ a == a2 && b == b2
96− && cachedTest == test
98 Project.App _ ->
95 Project.App _ ->
@@ -112,12 +109,12 @@ instance Binary MiniSummary where
112instance Binary ProjectDeps where
109instance Binary ProjectDeps where
113 put deps =
110 put deps =
114 case deps of
111 case deps of
115− App a b c -> putWord8 0 >> put a >> put b >> put c
112+ App a b c d -> putWord8 0 >> put a >> put b >> put c >> put d
116− Pkg a b -> putWord8 1 >> put a >> put b
113+ Pkg a b -> putWord8 1 >> put a >> put b
119 do n <- getWord8
116 do n <- getWord8
120 case n of
117 case n of
121− 0 -> liftM3 App get get get
118+ 0 -> liftM4 App get get get get
122 1 -> liftM2 Pkg get get
119 1 -> liftM2 Pkg get get
123 _ -> error "binary encoding of ProjectDeps was corrupted"
120 _ -> error "binary encoding of ProjectDeps was corrupted"