diff options
author | Michael Raskin <7c6f434c@mail.ru> | 2007-11-10 13:35:50 +0000 |
---|---|---|
committer | Michael Raskin <7c6f434c@mail.ru> | 2007-11-10 13:35:50 +0000 |
commit | d93753b79455bfcf19a9c3c6f797b1c7fa5b8cf1 (patch) | |
tree | ddb70f4fc540505a545396c64552fc0be73ff39a /pkgs/build-support/checker | |
parent | 9d1fc7c5ba00ed2b90889d629eb16c2b0778f106 (diff) | |
download | nixpkgs-d93753b79455bfcf19a9c3c6f797b1c7fa5b8cf1.tar nixpkgs-d93753b79455bfcf19a9c3c6f797b1c7fa5b8cf1.tar.gz nixpkgs-d93753b79455bfcf19a9c3c6f797b1c7fa5b8cf1.tar.bz2 nixpkgs-d93753b79455bfcf19a9c3c6f797b1c7fa5b8cf1.tar.lz nixpkgs-d93753b79455bfcf19a9c3c6f797b1c7fa5b8cf1.tar.xz nixpkgs-d93753b79455bfcf19a9c3c6f797b1c7fa5b8cf1.tar.zst nixpkgs-d93753b79455bfcf19a9c3c6f797b1c7fa5b8cf1.zip |
Fixed option checker after changin option format.
svn path=/nixpkgs/trunk/; revision=9621
Diffstat (limited to 'pkgs/build-support/checker')
-rw-r--r-- | pkgs/build-support/checker/default.nix | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/pkgs/build-support/checker/default.nix b/pkgs/build-support/checker/default.nix index 989d5813383..ebf977d4755 100644 --- a/pkgs/build-support/checker/default.nix +++ b/pkgs/build-support/checker/default.nix @@ -3,24 +3,27 @@ # options: configuration: with builtins; -with (import ../../lib); +let lib=(import ../../lib); in +with lib; -let +let findInList = p: list: default: - if (list == []) then default else - if (p (head list)) then (head list) else - findInList p (tail list) default; + if (list == []) then default else + if (p (head list)) then (head list) else + findInList p (tail list) default; - attrSetToList = attrs: if (isAttrs attrs) then (concatLists (map - (s: - (map (l: ([s] ++ l)) - (attrSetToList (getAttr s attrs)))) - (attrNames attrs))) else [[]]; -in -let opts = (map (a: a.name) options); - conf = attrSetToList configuration; -in -let res=findInList (a: (findInList (b: (eqLists a b)) opts null)==null) conf null; -in -#if res==null then null else map (l: ["<"] ++ l ++ [">"]) res -res + + checkAttrInclusion = s: a: b: + ( + if (! isAttrs b) then s else + if (lib.getAttr ["_type"] "" b) == "option" then "" else + findInList (x : x != "") + (map (x: checkAttrInclusion + (s + "." + x) + (__getAttr x a) + (lib.getAttr [x] null b)) + (attrNames a)) "" + ); +in + checkAttrInclusion "" configuration options + |