* options.nix:
Remove attribute set comparison. Imported attribute sets are traverse assuming that no duplicate could exists. svn path=/nixpkgs/trunk/; revision=15659
This commit is contained in:
parent
47679b20af
commit
1500252e6f
@ -146,6 +146,7 @@ rec {
|
|||||||
|| builtins.isList x
|
|| builtins.isList x
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
# Evaluate a list of option sets that would be merged with the
|
# Evaluate a list of option sets that would be merged with the
|
||||||
# function "merge" which expects two arguments. The attribute named
|
# function "merge" which expects two arguments. The attribute named
|
||||||
# "require" is used to imports option declarations and bindings.
|
# "require" is used to imports option declarations and bindings.
|
||||||
@ -192,13 +193,27 @@ rec {
|
|||||||
cfg3 = noImportConditions cfg2;
|
cfg3 = noImportConditions cfg2;
|
||||||
in cfg3;
|
in cfg3;
|
||||||
|
|
||||||
getRequire = x:
|
getRequire = x: toList (getAttr ["require"] [] (preprocess x));
|
||||||
toList (getAttr ["require"] [] (preprocess x));
|
getRecusiveRequire = x:
|
||||||
|
fold (cfg: l:
|
||||||
|
if isPath cfg then
|
||||||
|
[ cfg ] ++ l
|
||||||
|
else
|
||||||
|
[ cfg ] ++ (getRecusiveRequire cfg) ++ l
|
||||||
|
) [] (getRequire x);
|
||||||
|
|
||||||
|
getRequireSets = x: filter (x: ! isPath x) (getRecusiveRequire x);
|
||||||
|
getRequirePaths = x: filter isPath (getRecusiveRequire x);
|
||||||
rmRequire = x: removeAttrs (preprocess x) ["require"];
|
rmRequire = x: removeAttrs (preprocess x) ["require"];
|
||||||
|
|
||||||
|
inlineRequiredSets = cfgs:
|
||||||
|
fold (cfg: l: [ cfg ] ++ (getRequireSets cfg) ++ l) [] cfgs;
|
||||||
in
|
in
|
||||||
merge "" (
|
merge "" (
|
||||||
map rmRequire (
|
map rmRequire (
|
||||||
lib.uniqFlatten getRequire [] [] (toList opts)
|
inlineRequiredSets (
|
||||||
|
lib.uniqFlatten getRequirePaths [] [] (toList opts)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user