mirror of
https://github.com/nix-community/dream2nix.git
synced 2025-01-03 20:06:15 +03:00
simpleTranslate2: ignore irrelevant dependency objects
This commit is contained in:
parent
e37041d443
commit
d6d94d88db
@ -92,7 +92,15 @@
|
||||
;
|
||||
};
|
||||
|
||||
allDependencies =
|
||||
/*
|
||||
format:
|
||||
{
|
||||
foo = {
|
||||
"1.0.0" = finalObj
|
||||
}
|
||||
}
|
||||
*/
|
||||
makeDependencies = finalObjects:
|
||||
l.foldl'
|
||||
(result: finalObj:
|
||||
lib.recursiveUpdate
|
||||
@ -105,6 +113,31 @@
|
||||
{}
|
||||
finalObjects;
|
||||
|
||||
allDependencies = makeDependencies finalObjects;
|
||||
|
||||
exportedFinalObjects =
|
||||
l.filter
|
||||
(finalObj:
|
||||
exportedPackages.${finalObj.name} or null == finalObj.version)
|
||||
finalObjects;
|
||||
|
||||
relevantFinalObjects = l.genericClosure {
|
||||
startSet =
|
||||
l.map
|
||||
(finalObj:
|
||||
finalObj
|
||||
// {key = "${finalObj.name}#${finalObj.version}";})
|
||||
exportedFinalObjects;
|
||||
operator = finalObj:
|
||||
l.map
|
||||
(c:
|
||||
allDependencies.${c.name}.${c.version}
|
||||
// {key = "${c.name}#${c.version}";})
|
||||
finalObj.dependencies;
|
||||
};
|
||||
|
||||
relevantDependencies = makeDependencies relevantFinalObjects;
|
||||
|
||||
sources =
|
||||
l.mapAttrs
|
||||
(name: versions: let
|
||||
@ -120,7 +153,7 @@
|
||||
l.mapAttrs
|
||||
(version: finalObj: finalObj.sourceSpec)
|
||||
filteredObjects)
|
||||
allDependencies;
|
||||
relevantDependencies;
|
||||
|
||||
dependencyGraph =
|
||||
lib.mapAttrs
|
||||
@ -128,7 +161,7 @@
|
||||
lib.mapAttrs
|
||||
(version: finalObj: finalObj.dependencies)
|
||||
versions)
|
||||
allDependencies;
|
||||
relevantDependencies;
|
||||
|
||||
cyclicDependencies =
|
||||
# TODO: inefficient! Implement some kind of early cutoff
|
||||
|
Loading…
Reference in New Issue
Block a user