From 253c6f69c8ccbce28506a2373bb0cc16e67c04de Mon Sep 17 00:00:00 2001 From: Aaron Boman Date: Wed, 3 Sep 2014 16:00:40 -0500 Subject: [PATCH] Init params should be unique with requirements. Variable name shadowing. --- src/tools/common.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/tools/common.py b/src/tools/common.py index b1ee26f0c..749f7a9be 100644 --- a/src/tools/common.py +++ b/src/tools/common.py @@ -173,6 +173,7 @@ def check_init_parameters(toolset, requirement, *args): The return value from this rule is a condition to be used for flags settings. """ + from b2.build import toolset as b2_toolset # The type checking here is my best guess about # what the types should be. assert(isinstance(toolset, str)) @@ -233,6 +234,11 @@ def check_init_parameters(toolset, requirement, *args): sig = sig + value + '-' + # if a requirement is specified, the signature should be unique + # with that requirement + if requirement: + sig += '-' + requirement + if __all_signatures.has_key(sig): message = "duplicate initialization of '%s' with the following parameters: " % toolset @@ -255,7 +261,7 @@ def check_init_parameters(toolset, requirement, *args): if requirement: r = ['' + toolset, requirement] r = ','.join(r) - toolset.add_requirements([r + ':' + c for c in subcondition]) + b2_toolset.add_requirements([r + ':' + c for c in subcondition]) # We add the requirements, if any, to the condition to scope the toolset # variables and options to this specific version. @@ -846,4 +852,4 @@ def init(manager): engine.register_action("common.hard-link", __RM + ' "$(<)" 2$(NULL_OUT) $(NULL_OUT)' + os.linesep + - __LN + ' "$(>)" "$(<)" $(NULL_OUT)') + __LN + ' "$(>)" "$(<)" $(NULL_OUT)') \ No newline at end of file