summary refs log tree commit diff
path: root/pkgs/lib/misc.nix
diff options
context:
space:
mode:
authorMichael Raskin <7c6f434c@mail.ru>2010-06-29 22:18:49 +0000
committerMichael Raskin <7c6f434c@mail.ru>2010-06-29 22:18:49 +0000
commit14eea491b82663117e9a40a65b01a86b9549ee03 (patch)
tree062ad46122aa36a84aa1c28e79ac030b16d6f87e /pkgs/lib/misc.nix
parentf366f3020c08bb5d337e07b025829e44e497872c (diff)
downloadnixpkgs-14eea491b82663117e9a40a65b01a86b9549ee03.tar
nixpkgs-14eea491b82663117e9a40a65b01a86b9549ee03.tar.gz
nixpkgs-14eea491b82663117e9a40a65b01a86b9549ee03.tar.bz2
nixpkgs-14eea491b82663117e9a40a65b01a86b9549ee03.tar.lz
nixpkgs-14eea491b82663117e9a40a65b01a86b9549ee03.tar.xz
nixpkgs-14eea491b82663117e9a40a65b01a86b9549ee03.tar.zst
nixpkgs-14eea491b82663117e9a40a65b01a86b9549ee03.zip
Adding Redstore HTTP RDF/SPARQL server
svn path=/nixpkgs/trunk/; revision=22428
Diffstat (limited to 'pkgs/lib/misc.nix')
-rw-r--r--pkgs/lib/misc.nix9
1 files changed, 7 insertions, 2 deletions
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
@@ -95,6 +95,11 @@ rec {
 
   
   # 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);});