diff options
author | Michael Raskin <7c6f434c@mail.ru> | 2007-08-11 11:14:36 +0000 |
---|---|---|
committer | Michael Raskin <7c6f434c@mail.ru> | 2007-08-11 11:14:36 +0000 |
commit | 118e9d6ebf3c8106acc6a26fb9cc44a6feb70545 (patch) | |
tree | dcbf5e2465777a8f17dfa8639eabbd7881c83055 /pkgs/lib | |
parent | efbabdb59809bc03d93c3b3013357ba09c1e4666 (diff) | |
download | nixpkgs-118e9d6ebf3c8106acc6a26fb9cc44a6feb70545.tar nixpkgs-118e9d6ebf3c8106acc6a26fb9cc44a6feb70545.tar.gz nixpkgs-118e9d6ebf3c8106acc6a26fb9cc44a6feb70545.tar.bz2 nixpkgs-118e9d6ebf3c8106acc6a26fb9cc44a6feb70545.tar.lz nixpkgs-118e9d6ebf3c8106acc6a26fb9cc44a6feb70545.tar.xz nixpkgs-118e9d6ebf3c8106acc6a26fb9cc44a6feb70545.tar.zst nixpkgs-118e9d6ebf3c8106acc6a26fb9cc44a6feb70545.zip |
Corrected a flaw that made automated package silently accept any extra arguments
svn path=/nixpkgs/trunk/; revision=9101
Diffstat (limited to 'pkgs/lib')
-rw-r--r-- | pkgs/lib/default.nix | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pkgs/lib/default.nix b/pkgs/lib/default.nix index a6e87b21802..2359a1d3dd0 100644 --- a/pkgs/lib/default.nix +++ b/pkgs/lib/default.nix @@ -127,6 +127,7 @@ rec { # Return true only if there is an attribute and it is true. checkFlag = attrSet: name: if (name == "true") then true else + if (name == "false") then false else getAttr [name] false attrSet ; logicalOR = x: y: x || y; @@ -160,4 +161,13 @@ rec { if (list == []) then false else if (x == (head list)) then true else isInList (tail list) x; + + uniqList = {inputList, outputList ? []}: + if (inputList == []) then outputList else + let x=head inputList; + newOutputList = outputList ++ + (if (isInList outputList x) then [] else [x]); + in uniqList {outputList=newOutputList; + inputList = (tail inputList);}; + } |