mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-02-14 11:55:48 +01:00
Treat package list instead as a set
This commit is contained in:
parent
d69497ebf9
commit
55880e0f15
@ -23,7 +23,9 @@ getBuildPlanR slug = do
|
|||||||
|
|
||||||
fp <- fmap fpToString $ ltsFP $ concat [tshow major, ".", tshow minor]
|
fp <- fmap fpToString $ ltsFP $ concat [tshow major, ".", tshow minor]
|
||||||
bp <- liftIO $ decodeFileEither fp >>= either throwIO return
|
bp <- liftIO $ decodeFileEither fp >>= either throwIO return
|
||||||
packages <- lookupGetParams "package"
|
-- treat packages as a set to skip duplicates and make order of parameters
|
||||||
|
-- irrelevant
|
||||||
|
packages <- setFromList <$> lookupGetParams "package"
|
||||||
when (null packages) $ invalidArgs ["Must provide at least one package"]
|
when (null packages) $ invalidArgs ["Must provide at least one package"]
|
||||||
fullDeps <- (== Just "true") <$> lookupGetParam "full-deps"
|
fullDeps <- (== Just "true") <$> lookupGetParam "full-deps"
|
||||||
let eres = runCatch $ execStateT (getDeps bp fullDeps packages) (mempty, id)
|
let eres = runCatch $ execStateT (getDeps bp fullDeps packages) (mempty, id)
|
||||||
@ -79,7 +81,7 @@ type DList a = [a] -> [a]
|
|||||||
getDeps :: (MonadThrow m, MonadState TheState m)
|
getDeps :: (MonadThrow m, MonadState TheState m)
|
||||||
=> BuildPlan
|
=> BuildPlan
|
||||||
-> Bool
|
-> Bool
|
||||||
-> [Text]
|
-> Set Text
|
||||||
-> m ()
|
-> m ()
|
||||||
getDeps BuildPlan {..} fullDeps =
|
getDeps BuildPlan {..} fullDeps =
|
||||||
mapM_ (goName . PackageName . unpack)
|
mapM_ (goName . PackageName . unpack)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user