diff options
Diffstat (limited to 'tools/scan-build/set-xcode-analyzer')
-rwxr-xr-x | tools/scan-build/set-xcode-analyzer | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/scan-build/set-xcode-analyzer b/tools/scan-build/set-xcode-analyzer index 93824af..3076b39 100755 --- a/tools/scan-build/set-xcode-analyzer +++ b/tools/scan-build/set-xcode-analyzer @@ -4,9 +4,13 @@ # want to the use the system version of Python on Mac OS X. # This one has the scripting bridge enabled. +import sys +if sys.version_info < (2, 7): + print "set-xcode-analyzer requires Python 2.7 or later" + sys.exit(1) + import os import subprocess -import sys import re import tempfile import shutil @@ -41,6 +45,8 @@ def ModifySpec(path, isBuiltinAnalyzer, pathToChecker): m = re.search('^(\s*ExecPath\s*=\s*")', line) if m: line = "".join([m.group(0), pathToChecker, '";\n']) + # Do not modify further ExecPath's later in the xcspec. + foundAnalyzer = False t.write(line) t.close() print "(+) processing:", path @@ -70,7 +76,7 @@ def main(): for x in NSWorkspace.sharedWorkspace().runningApplications(): if x.localizedName().find("Xcode") >= 0: print "(-) You must quit Xcode first before modifying its configuration files." - return + sys.exit(1) isBuiltinAnalyzer = False if options.path: |