Remove name arguments from obsolete options.

svn path=/nixos/trunk/; revision=13864
This commit is contained in:
Nicolas Pierron 2009-01-25 20:47:30 +00:00
parent 348afe7dc6
commit c3f848e2d6

View File

@ -4,10 +4,10 @@ let
inherit (pkgs.lib) mkOption; inherit (pkgs.lib) mkOption;
inherit (builtins) head tail; inherit (builtins) head tail;
obsolete = what: f: name: obsolete = what: f:
if builtins ? trace then if builtins ? trace then
builtins.trace "${name}: Obsolete ${what}." f name builtins.trace "Obsolete ${what}." f
else f name; else f;
obsoleteMerge = obsoleteMerge =
obsolete "option" pkgs.lib.mergeDefaultOption; obsolete "option" pkgs.lib.mergeDefaultOption;
@ -15,18 +15,18 @@ let
# temporary modifications. # temporary modifications.
# backward here means that expression could either be a value or a # backward here means that expression could either be a value or a
# function which expects to have a pkgs argument. # function which expects to have a pkgs argument.
optionalPkgs = name: x: optionalPkgs = x:
if builtins.isFunction x if builtins.isFunction x
then obsolete "notation" (name: x pkgs) name then obsolete "notation" (x pkgs)
else x; else x;
backwardPkgsFunListMerge = name: list: backwardPkgsFunListMerge = list:
pkgs.lib.concatMap (optionalPkgs name) list; pkgs.lib.concatMap optionalPkgs list;
backwardPkgsFunMerge = name: list: backwardPkgsFunMerge = list:
if list != [] && tail list == [] if list != [] && tail list == []
then optionalPkgs name (head list) then optionalPkgs (head list)
else abort "${name}: Defined at least twice."; else abort "Defined at least twice.";
in in