Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(595)

Unified Diff: chrome/tools/build/mac/archive_symbols.py

Issue 2054893002: [Mac/GN] Add targets to run dump_syms and create the dSYM archive. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« chrome/BUILD.gn ('K') | « chrome/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« chrome/BUILD.gn ('K') | « chrome/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698