| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import argparse | 5 import argparse |
| 6 import os | 6 import os.path |
| 7 import sys |
| 7 import subprocess | 8 import subprocess |
| 8 import sys | 9 |
| 10 # Wraps chrome/tools/build/mac/verify_order for the GN build so that it can |
| 11 # write a stamp file, rather than operate as a postbuild. |
| 9 | 12 |
| 10 if __name__ == '__main__': | 13 if __name__ == '__main__': |
| 11 parser = argparse.ArgumentParser( | 14 parser = argparse.ArgumentParser( |
| 12 description='A script to execute a command via xcrun.') | 15 description='A wrapper around verify_order that writes a stamp file.') |
| 13 parser.add_argument('--stamp', action='store', type=str, | 16 parser.add_argument('--stamp', action='store', type=str, |
| 14 help='Write a stamp file to this path on success.') | 17 help='Touch this stamp file on success.') |
| 18 |
| 15 args, unknown_args = parser.parse_known_args() | 19 args, unknown_args = parser.parse_known_args() |
| 16 | 20 |
| 17 rv = subprocess.check_call(['xcrun'] + unknown_args) | 21 this_script_dir = os.path.dirname(sys.argv[0]) |
| 22 rv = subprocess.check_call( |
| 23 [ os.path.join(this_script_dir, 'verify_order') ] + unknown_args) |
| 24 |
| 18 if rv == 0 and args.stamp: | 25 if rv == 0 and args.stamp: |
| 19 if os.path.exists(args.stamp): | 26 if os.path.exists(args.stamp): |
| 20 os.unlink(args.stamp) | 27 os.unlink(args.stamp) |
| 21 open(args.stamp, 'w+').close() | 28 open(args.stamp, 'w+').close() |
| 22 | 29 |
| 23 sys.exit(rv) | 30 sys.exit(rv) |
| OLD | NEW |