Remove support for merge function with name argument.
svn path=/nixpkgs/trunk/; revision=13869
This commit is contained in:
parent
6c2c6d7fe4
commit
c2be87e132
|
@ -556,25 +556,14 @@ rec {
|
||||||
# function of each option to get the result.
|
# function of each option to get the result.
|
||||||
mergeOptionSets = noOption: newMergeOptionSets; # ignore argument
|
mergeOptionSets = noOption: newMergeOptionSets; # ignore argument
|
||||||
newMergeOptionSets =
|
newMergeOptionSets =
|
||||||
let
|
|
||||||
# handle merge functions with & without name argument.
|
|
||||||
mergeWrapper = merge: name: values:
|
|
||||||
let
|
|
||||||
newMerge = merge values;
|
|
||||||
oldMerge = builtins.trace
|
|
||||||
"obsolete: Merge function of ${name} option has name argument."
|
|
||||||
(merge name values);
|
|
||||||
in
|
|
||||||
if __isFunction newMerge then oldMerge else newMerge;
|
|
||||||
in
|
|
||||||
handleOptionSets {
|
handleOptionSets {
|
||||||
export = opt: values:
|
export = opt: values:
|
||||||
opt.apply (
|
opt.apply (
|
||||||
if values == [] then
|
if values == [] then
|
||||||
if opt ? default then opt.default
|
if opt ? default then opt.default
|
||||||
else throw "Not defined."
|
else throw "Not defined."
|
||||||
else mergeWrapper opt.merge opt.name values
|
else opt.merge values
|
||||||
);
|
));
|
||||||
notHandle = throw "Used without option declaration.";
|
notHandle = throw "Used without option declaration.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue