diff options
author | Gabriel Russell <gabriel.russell@mongodb.com> | 2017-02-28 17:03:55 -0500 |
---|---|---|
committer | Gabriel Russell <gabriel.russell@mongodb.com> | 2017-03-06 14:32:17 -0500 |
commit | 59681ee6603fc43f0f3209ec0f9c6a09476edfcc (patch) | |
tree | 23365fa10ef646948fc89902b66df827a9ef09eb /src/third_party | |
parent | 7f452ce6183ae00774e890fc8db7c3ca23e631c2 (diff) | |
download | mongo-59681ee6603fc43f0f3209ec0f9c6a09476edfcc.tar.gz |
SERVER-28149 cherry-picking the single scons-2.5.1 change
Diffstat (limited to 'src/third_party')
-rw-r--r-- | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/__init__.py | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/__init__.py b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/__init__.py index 3ce481b1f7e..6567489c30a 100644 --- a/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/__init__.py +++ b/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/__init__.py @@ -41,7 +41,7 @@ be able to depend on any other type of "thing." # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -__revision__ = "src/engine/SCons/Node/__init__.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog" +__revision__ = "src/engine/SCons/Node/__init__.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog" import collections import copy @@ -924,9 +924,9 @@ class Node(object): scanner's recursive flag says that we should. """ nodes = [self] - seen = {} - seen[self] = 1 + seen = set(nodes) dependencies = [] + path_memo = {} root_node_scanner = self._get_scanner(env, initial_scanner, None, kw) @@ -934,31 +934,33 @@ class Node(object): node = nodes.pop(0) scanner = node._get_scanner(env, initial_scanner, root_node_scanner, kw) - if not scanner: continue - path = path_func(scanner) + try: + path = path_memo[scanner] + except KeyError: + path = path_func(scanner) + path_memo[scanner] = path included_deps = [x for x in node.get_found_includes(env, scanner, path) if x not in seen] if included_deps: dependencies.extend(included_deps) - for dep in included_deps: - seen[dep] = 1 + seen.update(included_deps) nodes.extend(scanner.recurse_nodes(included_deps)) return dependencies def _get_scanner(self, env, initial_scanner, root_node_scanner, kw): - if not initial_scanner: + if initial_scanner: + # handle explicit scanner case + scanner = initial_scanner.select(self) + else: # handle implicit scanner case scanner = self.get_env_scanner(env, kw) if scanner: scanner = scanner.select(self) - else: - # handle explicit scanner case - scanner = initial_scanner.select(self) - + if not scanner: # no scanner could be found for the given node's scanner key; # thus, make an attempt at using a default. |