[cfe-commits] r95572 - /cfe/trunk/tools/scan-build/set-xcode-analyzer

Ted Kremenek kremenek at apple.com
Mon Feb 8 13:19:27 PST 2010


Author: kremenek
Date: Mon Feb  8 15:19:27 2010
New Revision: 95572

URL: http://llvm.org/viewvc/llvm-project?rev=95572&view=rev
Log:
Add some diagnostics for when we cannot update the original spec file.

Modified:
    cfe/trunk/tools/scan-build/set-xcode-analyzer

Modified: cfe/trunk/tools/scan-build/set-xcode-analyzer
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/scan-build/set-xcode-analyzer?rev=95572&r1=95571&r2=95572&view=diff

==============================================================================
--- cfe/trunk/tools/scan-build/set-xcode-analyzer (original)
+++ cfe/trunk/tools/scan-build/set-xcode-analyzer Mon Feb  8 15:19:27 2010
@@ -14,7 +14,6 @@
         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 @@
           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 @@
     print "Using the Clang bundled with Xcode"
     path = options.default
 
+  print ""
   for x in FindClangSpecs('/Developer'):
     ModifySpec(x, path)
 





More information about the cfe-commits mailing list