diff options
author | Michael Raskin <7c6f434c@mail.ru> | 2008-01-18 12:36:56 +0000 |
---|---|---|
committer | Michael Raskin <7c6f434c@mail.ru> | 2008-01-18 12:36:56 +0000 |
commit | bc46eaf4047f4cfd3152f3748f114b8743ed4faf (patch) | |
tree | 4ba6055a35af6b96427cd5b2186108f8a3551d9c /pkgs/lib/strings-with-deps.nix | |
parent | a5e0e39cdb575a38216a2a0e9ee25eae5bb05397 (diff) | |
download | nixpkgs-bc46eaf4047f4cfd3152f3748f114b8743ed4faf.tar nixpkgs-bc46eaf4047f4cfd3152f3748f114b8743ed4faf.tar.gz nixpkgs-bc46eaf4047f4cfd3152f3748f114b8743ed4faf.tar.bz2 nixpkgs-bc46eaf4047f4cfd3152f3748f114b8743ed4faf.tar.lz nixpkgs-bc46eaf4047f4cfd3152f3748f114b8743ed4faf.tar.xz nixpkgs-bc46eaf4047f4cfd3152f3748f114b8743ed4faf.tar.zst nixpkgs-bc46eaf4047f4cfd3152f3748f114b8743ed4faf.zip |
Some review of builder-defs and dependent files. No rebuild needed. Now it should be possible to override elements in builderDefs
svn path=/nixpkgs/trunk/; revision=10214
Diffstat (limited to 'pkgs/lib/strings-with-deps.nix')
-rw-r--r-- | pkgs/lib/strings-with-deps.nix | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/pkgs/lib/strings-with-deps.nix b/pkgs/lib/strings-with-deps.nix index c70c1f2728d..4fb4fe150a7 100644 --- a/pkgs/lib/strings-with-deps.nix +++ b/pkgs/lib/strings-with-deps.nix @@ -18,7 +18,7 @@ args: with lib; let inherit (builtins) - head tail isList; + head tail isList isAttrs; in rec { @@ -52,12 +52,23 @@ rec { (concatLists (map textClosureDupList arg.deps)) ++ [arg] ); - textClosureList = 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 = textClosureDupList arg;})); - textClosure = arg: concatStringsSep "\n" (textClosureList arg); + (uniqList {inputList = textClosureDupListOverridable predefined arg;})); + textClosureOverridable = predefined: arg: concatStringsSep "\n" (textClosureListOverridable predefined arg); - textClosureMap = f: arg: concatStringsSep "\n" (map f (textClosureList arg)); + textClosureMapOveridable = f: predefined: arg: + concatStringsSep "\n" (map f (textClosureListOverridable predefined arg)); noDepEntry = text : {inherit text;deps = [];}; FullDepEntry = text : deps: {inherit text deps;}; |