From 0339bd00abe448313c90da84d9c98ec6ff51a9c9 Mon Sep 17 00:00:00 2001 From: Aaron Boman Date: Wed, 3 Sep 2014 16:03:31 -0500 Subject: [PATCH 1/6] Command in init should be a list, not a string --- src/tools/msvc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/msvc.py b/src/tools/msvc.py index 1f9cc2ccb..02dce9f9e 100644 --- a/src/tools/msvc.py +++ b/src/tools/msvc.py @@ -115,7 +115,7 @@ def init(version = None, command = None, options = None): command = to_seq(command) if command: - options.append(""+command) + options.extend(""+cmd for cmd in command) configure(version,options) def configure(version=None, options=None): From 632ab9c8665f96399b75d4c36b7e50db9cd05812 Mon Sep 17 00:00:00 2001 From: Aaron Boman Date: Wed, 3 Sep 2014 15:56:28 -0500 Subject: [PATCH 2/6] Use module name instead of Match instance for key of __module_flags. --- src/build/toolset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build/toolset.py b/src/build/toolset.py index 3665ab872..e969123d4 100644 --- a/src/build/toolset.py +++ b/src/build/toolset.py @@ -362,7 +362,7 @@ def __add_flag (rule_or_module, variable_name, condition, values): assert m module = m.group(1) - __module_flags.setdefault(m, []).append(f) + __module_flags.setdefault(module, []).append(f) __flags.setdefault(rule_or_module, []).append(f) __requirements = [] From 253c6f69c8ccbce28506a2373bb0cc16e67c04de Mon Sep 17 00:00:00 2001 From: Aaron Boman Date: Wed, 3 Sep 2014 16:00:40 -0500 Subject: [PATCH 3/6] 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 From 064448b38135fc6412b9337c04bf53bc4d83ecae Mon Sep 17 00:00:00 2001 From: Aaron Boman Date: Wed, 3 Sep 2014 16:04:18 -0500 Subject: [PATCH 4/6] Command param in init should be a list or handle when it is a string. --- src/tools/common.py | 2 +- src/tools/msvc.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tools/common.py b/src/tools/common.py index 749f7a9be..7a9348bf2 100644 --- a/src/tools/common.py +++ b/src/tools/common.py @@ -852,4 +852,4 @@ def init(manager): engine.register_action("common.hard-link", __RM + ' "$(<)" 2$(NULL_OUT) $(NULL_OUT)' + os.linesep + - __LN + ' "$(>)" "$(<)" $(NULL_OUT)') \ No newline at end of file + __LN + ' "$(>)" "$(<)" $(NULL_OUT)') diff --git a/src/tools/msvc.py b/src/tools/msvc.py index 02dce9f9e..7daadffd9 100644 --- a/src/tools/msvc.py +++ b/src/tools/msvc.py @@ -115,7 +115,10 @@ def init(version = None, command = None, options = None): command = to_seq(command) if command: - options.extend(""+cmd for cmd in command) + if isinstance(command, str): + options.append('' + command) + else: + options.extend(""+cmd for cmd in command) configure(version,options) def configure(version=None, options=None): From 71da5c4d8c6e97576358730f63be7d2f56654b7d Mon Sep 17 00:00:00 2001 From: Aaron Boman Date: Thu, 4 Sep 2014 10:45:41 -0500 Subject: [PATCH 5/6] Second argmuent to type.register should be list. This registers the extensions t, l, and b instead of 'tlb'. --- src/tools/midl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/midl.py b/src/tools/midl.py index 43bcdf6fe..86c1f34b6 100644 --- a/src/tools/midl.py +++ b/src/tools/midl.py @@ -22,7 +22,7 @@ type.register('IDL', ['idl']) # to resources of an application (.rc). In order to be found by a resource # compiler its target type should be derived from 'H' - otherwise # the property '' will be ignored. -type.register('MSTYPELIB', 'tlb', 'H') +type.register('MSTYPELIB', ['tlb'], 'H') # Register scanner for MIDL files class MidlScanner(scanner.Scanner): From f4eeca53ed414ea9606c2468ff71dbaad8716e52 Mon Sep 17 00:00:00 2001 From: Aaron Boman Date: Thu, 4 Sep 2014 10:50:40 -0500 Subject: [PATCH 6/6] Prevent errors for double path separtors in PATH. --- src/util/path.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/util/path.py b/src/util/path.py index 222b96bfe..5bbf99cc6 100644 --- a/src/util/path.py +++ b/src/util/path.py @@ -418,7 +418,11 @@ def programs_path (): for elem in raw: if elem: for p in elem.split(os.path.pathsep): - result.append(make(p)) + # it's possible that the user's Path has + # double path separators, thus it is possible + # for p to be an empty string. + if p: + result.append(make(p)) return result