Changed comparison operator so that we don't get caught in an infinite loop

This commit is contained in:
Mario Melara 2016-05-26 11:09:14 -07:00
parent c30fe932d9
commit 3b675d8b70

View file

@ -330,6 +330,8 @@ def concretize_compiler_flags(self, spec):
compiler is used, defaulting to no compiler flags in the spec. compiler is used, defaulting to no compiler flags in the spec.
Default specs set at the compiler level will still be added later. Default specs set at the compiler level will still be added later.
""" """
if not spec.architecture.platform_os: if not spec.architecture.platform_os:
#Although this usually means changed, this means awaiting other changes #Although this usually means changed, this means awaiting other changes
return True return True
@ -340,9 +342,9 @@ def concretize_compiler_flags(self, spec):
nearest = next(p for p in spec.traverse(direction='parents') nearest = next(p for p in spec.traverse(direction='parents')
if ((p.compiler == spec.compiler and p is not spec) if ((p.compiler == spec.compiler and p is not spec)
and flag in p.compiler_flags)) and flag in p.compiler_flags))
if ((not flag in spec.compiler_flags) or if not flag in spec.compiler_flags or \
sorted(spec.compiler_flags[flag]) != sorted(nearest.compiler_flags[flag])): not (sorted(spec.compiler_flags[flag]) >= sorted(nearest.compiler_flags[flag])):
if flag in spec.compiler_flags: if flag in spec.compiler_flag:
spec.compiler_flags[flag] = list(set(spec.compiler_flags[flag]) | spec.compiler_flags[flag] = list(set(spec.compiler_flags[flag]) |
set(nearest.compiler_flags[flag])) set(nearest.compiler_flags[flag]))
else: else: