summaryrefslogtreecommitdiffstats
path: root/tools/scan-build
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-02-08 21:19:27 +0000
committerTed Kremenek <kremenek@apple.com>2010-02-08 21:19:27 +0000
commit757a9d1f005ffb8a628a247a11a9869cf8f336c0 (patch)
tree2f18cf095795b4fc35e2b4993752a4cbba200913 /tools/scan-build
parent15ced59e27cdc4c4978b9422ca5f8805f7f64b64 (diff)
Add some diagnostics for when we cannot update the original spec file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95572 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/scan-build')
-rwxr-xr-xtools/scan-build/set-xcode-analyzer12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/scan-build/set-xcode-analyzer b/tools/scan-build/set-xcode-analyzer
index c8229da7f3..cf0ba3a1af 100755
--- a/tools/scan-build/set-xcode-analyzer
+++ b/tools/scan-build/set-xcode-analyzer
@@ -14,7 +14,6 @@ def FindClangSpecs(path):
yield os.path.join(root, f)
def ModifySpec(path, pathToChecker):
- print "Updating:", path
t = tempfile.NamedTemporaryFile(delete=False)
foundAnalyzer = False
with open(path) as f:
@@ -28,8 +27,14 @@ def ModifySpec(path, pathToChecker):
line = "".join([m.group(0), pathToChecker, '";\n'])
t.write(line)
t.close()
- shutil.copy(t.name, path)
- os.chmod(path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH)
+ print "(+)", path
+ try:
+ shutil.copy(t.name, path)
+ os.chmod(path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH)
+ except IOError, why:
+ print "\n Cannot update file:", why, "\n"
+ except OSError, why:
+ print "\n Cannot update file:", why, "\n"
os.unlink(t.name)
def main():
@@ -57,6 +62,7 @@ def main():
print "Using the Clang bundled with Xcode"
path = options.default
+ print ""
for x in FindClangSpecs('/Developer'):
ModifySpec(x, path)