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
4 # found in the LICENSE file.
6 """Unpacks pre-built sanitizer-instrumented third-party libraries."""
13 import download_binaries
16 def get_archive_name(archive_prefix
):
17 return '%s-%s.tgz' % (archive_prefix
, download_binaries
.get_ubuntu_release())
20 def main(archive_prefix
, archive_dir
, target_dir
, stamp_dir
=None):
21 shutil
.rmtree(target_dir
, ignore_errors
=True)
24 subprocess
.check_call([
27 os
.path
.join(archive_dir
, get_archive_name(archive_prefix
)),
30 stamp_file
= os
.path
.join(stamp_dir
or target_dir
, '%s.txt' % archive_prefix
)
31 open(stamp_file
, 'w').close()
34 with
open(os
.path
.join(stamp_dir
, '%s.d' % archive_prefix
), 'w') as f
:
36 stamp_file
, os
.path
.join(archive_dir
,
37 get_archive_name(archive_prefix
))))
41 if __name__
== '__main__':
42 sys
.exit(main(*sys
.argv
[1:]))