Commit 1ade2203 authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

Hoist out some functions in mkComponentLocalBuildInfo.


Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent 94e831ae
......@@ -1697,14 +1697,6 @@ mkComponentsLocalBuildInfo cfg comp installedPackages pkg_descr
componentPackageRenaming = cprns
}
where
-- TODO: this should include internal deps too
getDeps :: ComponentName -> [ComponentId]
getDeps cname =
let externalPkgs
= maybe [] (\lib -> selectSubset (componentBuildInfo lib)
externalPkgDeps)
(lookupComponent pkg_descr cname)
in map Installed.installedComponentId externalPkgs
-- TODO configIPID should have name changed
cid = computeComponentId (configIPID cfg) (package pkg_descr)
......@@ -1718,8 +1710,6 @@ mkComponentsLocalBuildInfo cfg comp installedPackages pkg_descr
bi = componentBuildInfo component
dedup = Map.toList . Map.fromList
lookupInternalPkg :: PackageId -> UnitId
lookupInternalPkg pkgid = do
let matcher (clbi, _)
......@@ -1743,6 +1733,17 @@ mkComponentsLocalBuildInfo cfg comp installedPackages pkg_descr
then targetBuildRenaming bi
else Map.empty
dedup = Map.toList . Map.fromList
-- TODO: this should include internal deps too
getDeps :: ComponentName -> [ComponentId]
getDeps cname =
let externalPkgs
= maybe [] (\lib -> selectSubset (componentBuildInfo lib)
externalPkgDeps)
(lookupComponent pkg_descr cname)
in map Installed.installedComponentId externalPkgs
selectSubset :: Package pkg => BuildInfo -> [pkg] -> [pkg]
selectSubset bi pkgs =
[ pkg | pkg <- pkgs, packageName pkg `elem` names bi ]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment