aboutsummaryrefslogtreecommitdiff
path: root/tools/shared.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-09-26 10:51:45 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-09-26 10:51:45 -0700
commita11ff3b3abdbc2052b352a07bfad29c644f3ff2d (patch)
tree9c73f72d8e4bdce41601162b44115df6f125948d /tools/shared.py
parente5338c8d8d7fd7bc72755d4f2dd3064ff2a2cea2 (diff)
parenta7eae6979a82e1a4a8c4c96d154ec4350288929a (diff)
Merge pull request #581 from LCID-Fire/debian_clang_check
Extract check_clang_version into an own function and correct checking so...
Diffstat (limited to 'tools/shared.py')
-rw-r--r--tools/shared.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/tools/shared.py b/tools/shared.py
index 700849e8..2fc894d0 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -47,12 +47,19 @@ 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 in actual:
+ return True
+
+ print >> sys.stderr, 'warning: LLVM version appears incorrect (seeing "%s", expected "%s")' % (actual, expected)
+ return False
+
+
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)