OLD | NEW |
(Empty) | |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 import os |
| 6 import subprocess |
| 7 import sys |
| 8 |
| 9 # This script creates a BZ2-compressed TAR file for archiving Chrome symbols. |
| 10 |
| 11 def Main(args): |
| 12 if len(args) < 2: |
| 13 print >> sys.stderr, "Usage: python archive_symbols.py file.tar.bz2 file..." |
| 14 return 1 |
| 15 |
| 16 _RemoveIfExists(args[0]) |
| 17 |
| 18 try: |
| 19 return subprocess.check_call(['tar', '-cjf'] + args) |
| 20 except: |
| 21 _RemoveIfExists(args[0]) |
| 22 raise |
| 23 |
| 24 |
| 25 def _RemoveIfExists(path): |
| 26 if os.path.exists(path): |
| 27 os.unlink(path) |
| 28 |
| 29 |
| 30 if __name__ == '__main__': |
| 31 sys.exit(Main(sys.argv[1:])) |
OLD | NEW |