mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-13 21:32:23 +03:00
Remove obsolete flattenAttrs function
This commit is contained in:
parent
8225460f82
commit
4f7917ac62
@ -212,7 +212,7 @@ rec {
|
||||
let loop = l: if tail l == [] then head l else loop (tail l); in
|
||||
loop list;
|
||||
|
||||
|
||||
|
||||
# Zip two lists together.
|
||||
zipTwoLists = xs: ys:
|
||||
if xs != [] && ys != [] then
|
||||
|
@ -322,10 +322,6 @@ rec {
|
||||
// listToAttrs (map (n : nameValuePair n (a: b: "${a}\n${b}") ) [ "preConfigure" "postInstall" ])
|
||||
;
|
||||
|
||||
# returns atribute values as a list
|
||||
flattenAttrs = set : map ( attr : builtins.getAttr attr set) (attrNames set);
|
||||
mapIf = cond : f : fold ( x : l : if (cond x) then [(f x)] ++ l else l) [];
|
||||
|
||||
# prepareDerivationArgs tries to make writing configurable derivations easier
|
||||
# example:
|
||||
# prepareDerivationArgs {
|
||||
@ -365,7 +361,7 @@ rec {
|
||||
flagName = name : "${name}Support";
|
||||
cfgWithDefaults = (listToAttrs (map (n : nameValuePair (flagName n) false) (attrNames args2.flags)))
|
||||
// args2.cfg;
|
||||
opts = flattenAttrs (mapAttrs (a : v :
|
||||
opts = attrValues (mapAttrs (a : v :
|
||||
let v2 = if (v ? set || v ? unset) then v else { set = v; };
|
||||
n = if (getAttr (flagName a) cfgWithDefaults) then "set" else "unset";
|
||||
attr = maybeAttr n {} v2; in
|
||||
|
Loading…
Reference in New Issue
Block a user