diff options
author | Michael Raskin <7c6f434c@mail.ru> | 2010-06-29 22:18:49 +0000 |
---|---|---|
committer | Michael Raskin <7c6f434c@mail.ru> | 2010-06-29 22:18:49 +0000 |
commit | 14eea491b82663117e9a40a65b01a86b9549ee03 (patch) | |
tree | 062ad46122aa36a84aa1c28e79ac030b16d6f87e /pkgs/lib/misc.nix | |
parent | f366f3020c08bb5d337e07b025829e44e497872c (diff) | |
download | nixpkgs-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.nix | 9 |
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);}); |