| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2014 the V8 project authors. All rights reserved. | 2 # Copyright 2014 the V8 project 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 """ | 6 """ |
| 7 This script runs every build as the first hook (See DEPS). If it detects that | 7 This script runs every build as the first hook (See DEPS). If it detects that |
| 8 the build should be clobbered, it will delete the contents of the build | 8 the build should be clobbered, it will delete the contents of the build |
| 9 directory. | 9 directory. |
| 10 | 10 |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 # Save current set of landmines for next time. | 191 # Save current set of landmines for next time. |
| 192 with open(landmines_path, 'w') as f: | 192 with open(landmines_path, 'w') as f: |
| 193 f.writelines(new_landmines) | 193 f.writelines(new_landmines) |
| 194 | 194 |
| 195 | 195 |
| 196 def process_options(): | 196 def process_options(): |
| 197 """Returns a list of landmine emitting scripts.""" | 197 """Returns a list of landmine emitting scripts.""" |
| 198 parser = optparse.OptionParser() | 198 parser = optparse.OptionParser() |
| 199 parser.add_option( | 199 parser.add_option( |
| 200 '-s', '--landmine-scripts', action='append', | 200 '-s', '--landmine-scripts', action='append', |
| 201 default=[os.path.join(SRC_DIR, 'build', 'get_landmines.py')], | 201 default=[os.path.join(SRC_DIR, 'gypfiles', 'get_landmines.py')], |
| 202 help='Path to the script which emits landmines to stdout. The target ' | 202 help='Path to the script which emits landmines to stdout. The target ' |
| 203 'is passed to this script via option -t. Note that an extra ' | 203 'is passed to this script via option -t. Note that an extra ' |
| 204 'script can be specified via an env var EXTRA_LANDMINES_SCRIPT.') | 204 'script can be specified via an env var EXTRA_LANDMINES_SCRIPT.') |
| 205 parser.add_option('-v', '--verbose', action='store_true', | 205 parser.add_option('-v', '--verbose', action='store_true', |
| 206 default=('LANDMINES_VERBOSE' in os.environ), | 206 default=('LANDMINES_VERBOSE' in os.environ), |
| 207 help=('Emit some extra debugging information (default off). This option ' | 207 help=('Emit some extra debugging information (default off). This option ' |
| 208 'is also enabled by the presence of a LANDMINES_VERBOSE environment ' | 208 'is also enabled by the presence of a LANDMINES_VERBOSE environment ' |
| 209 'variable.')) | 209 'variable.')) |
| 210 | 210 |
| 211 options, args = parser.parse_args() | 211 options, args = parser.parse_args() |
| (...skipping 24 matching lines...) Expand all Loading... |
| 236 proc = subprocess.Popen([sys.executable, s], stdout=subprocess.PIPE) | 236 proc = subprocess.Popen([sys.executable, s], stdout=subprocess.PIPE) |
| 237 output, _ = proc.communicate() | 237 output, _ = proc.communicate() |
| 238 landmines.extend([('%s\n' % l.strip()) for l in output.splitlines()]) | 238 landmines.extend([('%s\n' % l.strip()) for l in output.splitlines()]) |
| 239 clobber_if_necessary(landmines) | 239 clobber_if_necessary(landmines) |
| 240 | 240 |
| 241 return 0 | 241 return 0 |
| 242 | 242 |
| 243 | 243 |
| 244 if __name__ == '__main__': | 244 if __name__ == '__main__': |
| 245 sys.exit(main()) | 245 sys.exit(main()) |
| OLD | NEW |