diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2009-05-11 11:55:05 +0000 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2009-05-11 11:55:05 +0000 |
commit | 2f33cdec3896f45778064169639138bc4f75771a (patch) | |
tree | 6e8a9afcd5fb9d1d522bc7aa32a452cd3b7d03c8 /pkgs/lib/strings-with-deps.nix | |
parent | 27152e987af55d46f75c7da70e207f0ff52149cb (diff) | |
download | nixpkgs-2f33cdec3896f45778064169639138bc4f75771a.tar nixpkgs-2f33cdec3896f45778064169639138bc4f75771a.tar.gz nixpkgs-2f33cdec3896f45778064169639138bc4f75771a.tar.bz2 nixpkgs-2f33cdec3896f45778064169639138bc4f75771a.tar.lz nixpkgs-2f33cdec3896f45778064169639138bc4f75771a.tar.xz nixpkgs-2f33cdec3896f45778064169639138bc4f75771a.tar.zst nixpkgs-2f33cdec3896f45778064169639138bc4f75771a.zip |
* Die tabs die. Also, renamed FullDepEntry and PackEntry to
fullDepEntry and packEntry for consistency. svn path=/nixpkgs/trunk/; revision=15549
Diffstat (limited to 'pkgs/lib/strings-with-deps.nix')
-rw-r--r-- | pkgs/lib/strings-with-deps.nix | 93 |
1 files changed, 37 insertions, 56 deletions
diff --git a/pkgs/lib/strings-with-deps.nix b/pkgs/lib/strings-with-deps.nix index 4fb4fe150a7..7664689647c 100644 --- a/pkgs/lib/strings-with-deps.nix +++ b/pkgs/lib/strings-with-deps.nix @@ -13,64 +13,45 @@ Usage: See trace/nixpkgs/trunk/pkgs/top-level/builder-defs.nix for some predefined build steps */ -args: - with args; - with lib; - let - inherit (builtins) - head tail isList isAttrs; -in -rec { +args: -/* - let shelllib = rec { - a= { - text = "aaaa"; - deps = [b c]; - }; - b = { - text = "b"; - }; - c = { - text = "c"; - deps = []; - }; - }; - in - - [textClosure [shelllib.a] - textclosure shelllib.a]; +with args; +with lib; - -*/ - - textClosureDupList = arg: - ( - if isList arg then - textClosureDupList {text = ""; deps = arg;} - else - (concatLists (map textClosureDupList arg.deps)) ++ [arg] - ); - - textClosureDupListOverridable = predefined: arg: - ( - if isList arg then - textClosureDupListOverridable predefined {text = ""; deps = arg;} - else if isAttrs arg then - (concatLists (map (textClosureDupListOverridable predefined) arg.deps)) ++ [arg] - else - textClosureDupListOverridable predefined (getAttr [arg] [] predefined) - ); +let + inherit (builtins) head tail isList isAttrs; +in - textClosureListOverridable = predefined: arg: - (map (x : x.text) - (uniqList {inputList = textClosureDupListOverridable predefined arg;})); - textClosureOverridable = predefined: arg: concatStringsSep "\n" (textClosureListOverridable predefined arg); - - textClosureMapOveridable = f: predefined: arg: - concatStringsSep "\n" (map f (textClosureListOverridable predefined arg)); +rec { - noDepEntry = text : {inherit text;deps = [];}; - FullDepEntry = text : deps: {inherit text deps;}; - PackEntry = deps: {inherit deps; text="";}; + textClosureDupList = arg: + if isList arg then + textClosureDupList {text = ""; deps = arg;} + else + concatLists (map textClosureDupList arg.deps) ++ [arg]; + + textClosureDupListOverridable = predefined: arg: + if isList arg then + textClosureDupListOverridable predefined {text = ""; deps = arg;} + else if isAttrs arg then + concatLists (map (textClosureDupListOverridable predefined) arg.deps) ++ [arg] + else + textClosureDupListOverridable predefined (getAttr [arg] [] predefined); + + textClosureListOverridable = predefined: arg: + map (x: x.text) (uniqList {inputList = textClosureDupListOverridable predefined arg;}); + + textClosureOverridable = predefined: arg: concatStringsSep "\n" (textClosureListOverridable predefined arg); + + textClosureMapOveridable = f: predefined: arg: + concatStringsSep "\n" (map f (textClosureListOverridable predefined arg)); + + noDepEntry = text: {inherit text; deps = [];}; + fullDepEntry = text: deps: {inherit text deps;}; + packEntry = deps: {inherit deps; text="";}; + + # Old names - don't use. + FullDepEntry = fullDepEntry; + PackEntry = packEntry; + } |