rename mapRecordFlatten to mapAttrsFlatten

svn path=/nixpkgs/trunk/; revision=17315
This commit is contained in:
Marc Weber 2009-09-20 21:54:20 +00:00
parent 47a2c768f9
commit 88e66ae7f4
2 changed files with 4 additions and 4 deletions

View File

@ -243,8 +243,8 @@ rec {
closePropagation = list: (uniqList {inputList = (innerClosePropagation [] list);});
# calls a function (f attr value ) for each record item. returns a list
# should be renamed to mapAttrsFlatten
mapRecordFlatten = f : r : map (attr: f attr (builtins.getAttr attr r) ) (attrNames r);
mapAttrsFlatten = 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
nvs = name : value : listToAttrs [ (nameValuePair name value) ];

View File

@ -37,12 +37,12 @@
let
inherit (builtins) getAttr attrNames;
inherit (lib) concatStringsSep mapRecordFlatten;
inherit (lib) concatStringsSep mapAttrsFlatten;
toConfigLine = name : set :
"[(\"name\",\"${name}\")," + ( concatStringsSep "," (map (a: "(\"${a}\",\"${getAttr a set}\")" ) (attrNames set)))+"]";
config = writeText "nix-repository-manager_config"
(bleedingEdgeRepos.managedRepoDir+"\n" +
concatStringsSep "\n" (mapRecordFlatten toConfigLine (bleedingEdgeRepos.repos)));
concatStringsSep "\n" (mapAttrsFlatten toConfigLine (bleedingEdgeRepos.repos)));
cfg = getConfig ["nixRepositoryManager" ] {};