From 887a7951ec46c51517dabe3ccaf4bed32ddea12f Mon Sep 17 00:00:00 2001 From: Gary Oberbrunner Date: Wed, 22 Dec 2010 19:31:30 +0000 Subject: Fix intel compiler to sort versions >9 correctly (esp. on Linux) --- src/engine/SCons/Tool/intelc.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/engine/SCons/Tool/intelc.py b/src/engine/SCons/Tool/intelc.py index dea5b92..b4a3c90 100644 --- a/src/engine/SCons/Tool/intelc.py +++ b/src/engine/SCons/Tool/intelc.py @@ -245,7 +245,11 @@ def get_all_compiler_versions(): m = re.search(r'([0-9][0-9.]*)$', d) if m: versions.append(m.group(1)) - return sorted(uniquify(versions)) # remove dups + def keyfunc(str): + """Given a dot-separated version string, return a tuple of ints representing it.""" + return [int(x) for x in str.split('.')] + # split into ints, sort, then remove dups + return sorted(uniquify(versions), key=keyfunc, reverse=True) def get_intel_compiler_top(version, abi): """ -- cgit v0.12