| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
| 5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
| 6 # | 6 # |
| 7 | 7 |
| 8 import optparse | 8 import optparse |
| 9 import os | 9 import os |
| 10 import shutil | 10 import shutil |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 process.wait() | 186 process.wait() |
| 187 if process.returncode != 0: | 187 if process.returncode != 0: |
| 188 raise Error(args[0] + " failed") | 188 raise Error(args[0] + " failed") |
| 189 | 189 |
| 190 | 190 |
| 191 def GClientRunHooks(): | 191 def GClientRunHooks(): |
| 192 Execute(['gclient', 'runhooks']) | 192 Execute(['gclient', 'runhooks']) |
| 193 | 193 |
| 194 | 194 |
| 195 def RunhooksIfNeeded(host_os, mode, arch, target_os): | 195 def RunhooksIfNeeded(host_os, mode, arch, target_os): |
| 196 if host_os != 'linux': |
| 197 return |
| 196 build_root = utils.GetBuildRoot(host_os) | 198 build_root = utils.GetBuildRoot(host_os) |
| 197 build_cookie_path = os.path.join(build_root, 'lastHooksTargetOS.txt') | 199 build_cookie_path = os.path.join(build_root, 'lastHooksTargetOS.txt') |
| 198 | 200 |
| 199 old_target_os = None | 201 old_target_os = None |
| 200 try: | 202 try: |
| 201 with open(build_cookie_path) as f: | 203 with open(build_cookie_path) as f: |
| 202 old_target_os = f.read(1024) | 204 old_target_os = f.read(1024) |
| 203 except IOError as e: | 205 except IOError as e: |
| 204 pass | 206 pass |
| 205 if target_os != old_target_os: | 207 if target_os != old_target_os: |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 process.wait() | 316 process.wait() |
| 315 if process.returncode != 0: | 317 if process.returncode != 0: |
| 316 print "BUILD FAILED" | 318 print "BUILD FAILED" |
| 317 return 1 | 319 return 1 |
| 318 | 320 |
| 319 return 0 | 321 return 0 |
| 320 | 322 |
| 321 | 323 |
| 322 if __name__ == '__main__': | 324 if __name__ == '__main__': |
| 323 sys.exit(Main()) | 325 sys.exit(Main()) |
| OLD | NEW |