OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import optparse | 6 import optparse |
7 import os | 7 import os |
8 import sys | 8 import sys |
9 import tarfile | 9 import tarfile |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 options.tar_path = options.tar_path.replace('%pepperrev%', | 43 options.tar_path = options.tar_path.replace('%pepperrev%', |
44 options.pepper_revision) | 44 options.pepper_revision) |
45 | 45 |
46 install_folders = ['bin', 'etc', 'include', 'lib', 'lib32', 'share'] | 46 install_folders = ['bin', 'etc', 'include', 'lib', 'lib32', 'share'] |
47 | 47 |
48 buildbot_common.BuildStep('Archive Build') | 48 buildbot_common.BuildStep('Archive Build') |
49 tar_file = None | 49 tar_file = None |
50 buildbot_common.RemoveFile(options.tar_path) | 50 buildbot_common.RemoveFile(options.tar_path) |
51 try: | 51 try: |
52 tar_file = tarfile.open(options.tar_path, mode='w:bz2') | 52 tar_file = tarfile.open(options.tar_path, mode='w:bz2', dereference=True) |
53 for subfolder in install_folders: | 53 for subfolder in install_folders: |
54 tar_file.add(os.path.join(options.install_dir, subfolder), | 54 tar_file.add(os.path.join(options.install_dir, subfolder), |
55 arcname=subfolder) | 55 arcname=subfolder) |
56 finally: | 56 finally: |
57 if tar_file: | 57 if tar_file: |
58 tar_file.close() | 58 tar_file.close() |
59 | 59 |
60 if not options.skip_upload: | 60 if not options.skip_upload: |
61 buildbot_common.Archive(os.path.basename(options.tar_path), | 61 buildbot_common.Archive(os.path.basename(options.tar_path), |
62 'nativeclient-mirror/nacl/nacl_sdk/%s' % options.upload_path, | 62 'nativeclient-mirror/nacl/nacl_sdk/%s' % options.upload_path, |
63 cwd=os.path.dirname(os.path.abspath(options.tar_path))) | 63 cwd=os.path.dirname(os.path.abspath(options.tar_path))) |
64 | 64 |
65 if __name__ == '__main__': | 65 if __name__ == '__main__': |
66 sys.exit(main(sys.argv)) | 66 sys.exit(main(sys.argv)) |
OLD | NEW |