mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-12 04:08:29 +01:00
Fix upload v2 core packages fpco/stackage#481
Simple fix: was only adding packages from the build plan, not from the core libraries list. Most of the annoyance in the patch is just dealing with the multiple PackageName and Version types.
This commit is contained in:
parent
5c3e4adf10
commit
706a977e19
@ -244,21 +244,17 @@ finishUpload
|
||||
, ltsStackage = sid
|
||||
}
|
||||
|
||||
let cores :: Set PackageName
|
||||
cores = setFromList
|
||||
$ map (PackageName . display . fst)
|
||||
$ mapToList
|
||||
let cores, nonCores :: Map PackageName Version
|
||||
cores = mapKeysWith const (PackageName . display)
|
||||
$ fmap (Version . display)
|
||||
$ siCorePackages
|
||||
$ bpSystemInfo siPlan
|
||||
forM_ (mapToList $ fmap ppVersion $ bpPackages siPlan) $ \(name', version') -> do
|
||||
let nameT = display name'
|
||||
mpair = (,)
|
||||
<$> fromPathPiece nameT
|
||||
<*> fromPathPiece (display version')
|
||||
(name, version) <-
|
||||
case mpair of
|
||||
Nothing -> error $ "Could not parse: " ++ show (name', version')
|
||||
Just pair -> return pair
|
||||
nonCores
|
||||
= mapKeysWith const (PackageName . display)
|
||||
$ fmap (Version . display . ppVersion)
|
||||
$ bpPackages siPlan
|
||||
forM_ (mapToList $ cores ++ nonCores) $ \(name, version) -> do
|
||||
let PackageName nameT = name
|
||||
insert_ Package
|
||||
{ packageStackage = sid
|
||||
, packageName' = name
|
||||
|
||||
Loading…
Reference in New Issue
Block a user