mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-27 22:03:54 +03:00
Increase robustness of tryEval use a bit
svn path=/nixpkgs/trunk/; revision=18200
This commit is contained in:
parent
866bbe32f2
commit
159dc0e0cb
@ -39,8 +39,19 @@ let
|
|||||||
if builtins ? tryEval then
|
if builtins ? tryEval then
|
||||||
let pairs = pkgs.lib.concatMap
|
let pairs = pkgs.lib.concatMap
|
||||||
(x:
|
(x:
|
||||||
let val = builtins.tryEval (processPackage (builtins.getAttr x attrSet)); in
|
let pair = builtins.tryEval
|
||||||
if builtins.isAttrs x && val.success && val.value != [] then [{name=x; value=val.value;}] else [])
|
(let
|
||||||
|
attrVal = (builtins.getAttr x attrSet);
|
||||||
|
in
|
||||||
|
{val=(processPackage attrVal);
|
||||||
|
attrVal = attrVal;
|
||||||
|
attrValIsAttrs = builtins.isAttrs attrVal;
|
||||||
|
});
|
||||||
|
success = (builtins.tryEval pair.value.attrVal).success;
|
||||||
|
in
|
||||||
|
if success && pair.value.attrValIsAttrs &&
|
||||||
|
pair.value.val != [] then
|
||||||
|
[{name= x; value=pair.value.val;}] else [])
|
||||||
(builtins.attrNames attrSet);
|
(builtins.attrNames attrSet);
|
||||||
in
|
in
|
||||||
builtins.listToAttrs pairs
|
builtins.listToAttrs pairs
|
||||||
@ -51,8 +62,8 @@ let
|
|||||||
if attrSet ? recurseForDerivations && attrSet.recurseForDerivations then
|
if attrSet ? recurseForDerivations && attrSet.recurseForDerivations then
|
||||||
packagesWithMetaPlatform attrSet
|
packagesWithMetaPlatform attrSet
|
||||||
else
|
else
|
||||||
if builtins.hasAttr "platforms" attrSet.meta
|
if attrSet ? meta && attrSet.meta ? platforms
|
||||||
then builtins.getAttr "platforms" attrSet.meta
|
then attrSet.meta.platforms
|
||||||
else [];
|
else [];
|
||||||
|
|
||||||
/* Common platform groups on which to test packages. */
|
/* Common platform groups on which to test packages. */
|
||||||
|
Loading…
Reference in New Issue
Block a user