rename mapRecordFlatten to mapAttrsFlatten
svn path=/nixpkgs/trunk/; revision=17315
This commit is contained in:
parent
47a2c768f9
commit
88e66ae7f4
@ -243,8 +243,8 @@ rec {
|
|||||||
closePropagation = list: (uniqList {inputList = (innerClosePropagation [] list);});
|
closePropagation = list: (uniqList {inputList = (innerClosePropagation [] list);});
|
||||||
|
|
||||||
# calls a function (f attr value ) for each record item. returns a list
|
# calls a function (f attr value ) for each record item. returns a list
|
||||||
# should be renamed to mapAttrsFlatten
|
mapAttrsFlatten = f : r : map (attr: f attr (builtins.getAttr attr r) ) (attrNames r);
|
||||||
mapRecordFlatten = f : r : map (attr: f attr (builtins.getAttr attr r) ) (attrNames r);
|
mapRecordFlatten = builtins.trace "depreceated usage of mapRecordFlatten, use mapAttrsFlatten instead" mapAttrsFlatten;
|
||||||
|
|
||||||
# attribute set containing one attribute
|
# attribute set containing one attribute
|
||||||
nvs = name : value : listToAttrs [ (nameValuePair name value) ];
|
nvs = name : value : listToAttrs [ (nameValuePair name value) ];
|
||||||
|
@ -37,12 +37,12 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
inherit (builtins) getAttr attrNames;
|
inherit (builtins) getAttr attrNames;
|
||||||
inherit (lib) concatStringsSep mapRecordFlatten;
|
inherit (lib) concatStringsSep mapAttrsFlatten;
|
||||||
toConfigLine = name : set :
|
toConfigLine = name : set :
|
||||||
"[(\"name\",\"${name}\")," + ( concatStringsSep "," (map (a: "(\"${a}\",\"${getAttr a set}\")" ) (attrNames set)))+"]";
|
"[(\"name\",\"${name}\")," + ( concatStringsSep "," (map (a: "(\"${a}\",\"${getAttr a set}\")" ) (attrNames set)))+"]";
|
||||||
config = writeText "nix-repository-manager_config"
|
config = writeText "nix-repository-manager_config"
|
||||||
(bleedingEdgeRepos.managedRepoDir+"\n" +
|
(bleedingEdgeRepos.managedRepoDir+"\n" +
|
||||||
concatStringsSep "\n" (mapRecordFlatten toConfigLine (bleedingEdgeRepos.repos)));
|
concatStringsSep "\n" (mapAttrsFlatten toConfigLine (bleedingEdgeRepos.repos)));
|
||||||
|
|
||||||
cfg = getConfig ["nixRepositoryManager" ] {};
|
cfg = getConfig ["nixRepositoryManager" ] {};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user