aboutsummaryrefslogtreecommitdiff
path: root/tools/shared.py
diff options
context:
space:
mode:
authorLCID Fire <lcid-fire@gmx.net>2012-09-22 17:57:35 +0200
committerLCID Fire <lcid-fire@gmx.net>2012-09-22 18:00:20 +0200
commitde2436e3d6157eed64b230f1f6ea4226d6acb98e (patch)
tree77cc13b075058971761ce377847e547801332d13 /tools/shared.py
parenta3e03954ae5a57cfad6cae7a1c364260c75cd2ea (diff)
Extract check_clang_version into an own function and correct checking so it works with Debian, too.
Version string in Debian is: "Debian clang version"!
Diffstat (limited to 'tools/shared.py')
-rw-r--r--tools/shared.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/shared.py b/tools/shared.py
index 24e6b707..020d2652 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -47,12 +47,15 @@ except Exception, e:
EXPECTED_LLVM_VERSION = (3,1)
+def check_clang_version():
+ expected = 'clang version ' + '.'.join(map(str, EXPECTED_LLVM_VERSION))
+ actual = Popen([CLANG, '-v'], stderr=PIPE).communicate()[1].split('\n')[0]
+ if expected not in actual:
+ print >> sys.stderr, 'warning: LLVM version appears incorrect (seeing "%s", expected "%s")' % (actual, expected)
+
def check_llvm_version():
try:
- expected = 'clang version ' + '.'.join(map(str, EXPECTED_LLVM_VERSION))
- actual = Popen([CLANG, '-v'], stderr=PIPE).communicate()[1].split('\n')[0][0:len(expected)]
- if expected != actual:
- print >> sys.stderr, 'warning: LLVM version appears incorrect (seeing "%s", expected "%s")' % (actual, expected)
+ check_clang_version();
except Exception, e:
print >> sys.stderr, 'warning: Could not verify LLVM version: %s' % str(e)