From 14eea491b82663117e9a40a65b01a86b9549ee03 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Tue, 29 Jun 2010 22:18:49 +0000 Subject: Adding Redstore HTTP RDF/SPARQL server svn path=/nixpkgs/trunk/; revision=22428 --- pkgs/lib/misc.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'pkgs/lib/misc.nix') diff --git a/pkgs/lib/misc.nix b/pkgs/lib/misc.nix index 32b30ee2fbf..f3eb7e8bf8f 100644 --- a/pkgs/lib/misc.nix +++ b/pkgs/lib/misc.nix @@ -94,6 +94,11 @@ rec { composedArgsAndFun = f: foldArgs defaultMerge f {}; + # shortcut for attrByPath ["name"] default attrs + maybeAttrNullable = name: default: attrs: + if attrs == null then default else + if (__hasAttr name attrs) then (__getAttr name attrs) else default; + # shortcut for attrByPath ["name"] default attrs maybeAttr = name: default: attrs: if (__hasAttr name attrs) then (__getAttr name attrs) else default; @@ -204,8 +209,8 @@ rec { innerClosePropagation (ready ++ [(head list)]) ((tail list) - ++ (maybeAttr "propagatedBuildInputs" [] (head list)) - ++ (maybeAttr "propagatedBuildNativeInputs" [] (head list))); + ++ (maybeAttrNullable "propagatedBuildInputs" [] (head list)) + ++ (maybeAttrNullable "propagatedBuildNativeInputs" [] (head list))); closePropagation = list: (uniqList {inputList = (innerClosePropagation [] list);}); -- cgit 1.4.1