Requires need option, not path

Valid requires
This commit is contained in:
2013-04-26 14:40:44 +02:00
parent 509f41e14c
commit 2c5bbb7bc0
6 changed files with 37 additions and 35 deletions

View File

@ -359,15 +359,17 @@ def apply_requires(opt, config):
settings = config.cfgimpl_get_settings()
setting = Property(settings, settings._get_properties(opt, False), opt)
trigger_actions = build_actions(opt._requires)
optpath = config.cfgimpl_get_context().cfgimpl_get_description().optimpl_get_path_by_opt(opt)
descr = config.cfgimpl_get_context().cfgimpl_get_description()
optpath = descr.optimpl_get_path_by_opt(opt)
for requires in trigger_actions.values():
matches = False
for require in requires:
if len(require) == 3:
path, expected, action = require
option, expected, action = require
inverse = False
elif len(require) == 4:
path, expected, action, inverse = require
option, expected, action, inverse = require
path = descr.optimpl_get_path_by_opt(option)
if path == optpath or path.startswith(optpath + '.'):
raise RequirementRecursionError(_("malformed requirements "
"imbrication detected for option: '{0}' "