2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-15 00:52:16 +00:00

Init params should be unique with requirements. Variable name shadowing.

This commit is contained in:
Aaron Boman
2014-09-03 16:00:40 -05:00
parent 632ab9c866
commit 253c6f69c8

View File

@@ -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>' + 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)')