Index: chrome/tools/build/mac/archive_symbols.py |
diff --git a/chrome/tools/build/mac/archive_symbols.py b/chrome/tools/build/mac/archive_symbols.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8c198e57047356f355004a25b7c27983c12c6738 |
--- /dev/null |
+++ b/chrome/tools/build/mac/archive_symbols.py |
@@ -0,0 +1,31 @@ |
+# Copyright 2016 The Chromium Authors. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+ |
+import os |
+import subprocess |
+import sys |
+ |
+# This script creates a BZ2-compressed TAR file for archiving Chrome symbols. |
+ |
+def Main(args): |
+ if len(args) < 3: |
+ print >> sys.stderr, "Usage: python archive_symbols.py file.tar.bz2 file..." |
+ return 1 |
+ |
+ _RemoveIfExists(args[1]) |
+ |
+ try: |
+ return subprocess.check_call(['tar', '-cjf'] + args[1:]) |
+ except: |
+ _RemoveIfExists(args[1]) |
+ raise |
+ |
+ |
+def _RemoveIfExists(path): |
+ if os.path.exists(path): |
Mark Mentovai
2016/06/09 18:48:04
try-catch swallowing OSError ENOENT might be more
Robert Sesek
2016/06/09 20:53:46
Ack, but will keep since this pattern is in a few
|
+ os.unlink(path) |
+ |
+ |
+if __name__ == '__main__': |
+ sys.exit(Main(sys.argv)) |
Mark Mentovai
2016/06/09 18:48:04
I like to call main with sys.argv[1:] (especially
Robert Sesek
2016/06/09 20:53:46
Done.
|