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

Side by Side Diff: third_party/instrumented_libraries/scripts/unpack_binaries.py

Issue 2792343003: Revert of Instrumented libraries: Remove dependence on GYP_DEFINES (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « third_party/instrumented_libraries/scripts/download_binaries.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2015 The Chromium Authors. All rights reserved. 2 # Copyright 2015 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 """Unpacks pre-built sanitizer-instrumented third-party libraries. 6 """Unpacks pre-built sanitizer-instrumented third-party libraries."""
7 This script should only be run by gn.
8 """
9 7
10 import os 8 import os
11 import subprocess 9 import subprocess
12 import shutil 10 import shutil
13 import sys 11 import sys
14 12
13 import download_binaries
15 14
16 def main(archive, stamp_file, target_dir): 15
16 def get_archive_name(archive_prefix):
17 return '%s-%s.tgz' % (archive_prefix, download_binaries.get_ubuntu_release())
18
19
20 def main(archive_prefix, archive_dir, target_dir, stamp_dir=None):
17 shutil.rmtree(target_dir, ignore_errors=True) 21 shutil.rmtree(target_dir, ignore_errors=True)
18 22
19 os.mkdir(target_dir) 23 os.mkdir(target_dir)
20 subprocess.check_call([ 24 subprocess.check_call([
21 'tar', 25 'tar',
22 '-zxf', 26 '-zxf',
23 archive, 27 os.path.join(archive_dir, get_archive_name(archive_prefix)),
24 '-C', 28 '-C',
25 target_dir]) 29 target_dir])
30 stamp_file = os.path.join(stamp_dir or target_dir, '%s.txt' % archive_prefix)
26 open(stamp_file, 'w').close() 31 open(stamp_file, 'w').close()
32
33 if stamp_dir:
34 with open(os.path.join(stamp_dir, '%s.d' % archive_prefix), 'w') as f:
35 f.write('%s: %s' % (
36 stamp_file, os.path.join(archive_dir,
37 get_archive_name(archive_prefix))))
27 return 0 38 return 0
28 39
29 40
30 if __name__ == '__main__': 41 if __name__ == '__main__':
31 sys.exit(main(*sys.argv[1:])) 42 sys.exit(main(*sys.argv[1:]))
OLDNEW
« no previous file with comments | « third_party/instrumented_libraries/scripts/download_binaries.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698