OLD | NEW |
1 # Copyright (c) 2012 Google Inc. All rights reserved. | 1 # Copyright (c) 2012 Google Inc. 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 from __future__ import with_statement | 5 from __future__ import with_statement |
6 | 6 |
7 import errno | 7 import errno |
8 import filecmp | 8 import filecmp |
9 import os.path | 9 import os.path |
10 import re | 10 import re |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 if sys.platform.startswith('sunos'): | 391 if sys.platform.startswith('sunos'): |
392 return 'solaris' | 392 return 'solaris' |
393 if sys.platform.startswith('freebsd'): | 393 if sys.platform.startswith('freebsd'): |
394 return 'freebsd' | 394 return 'freebsd' |
395 if sys.platform.startswith('aix'): | 395 if sys.platform.startswith('aix'): |
396 return 'aix' | 396 return 'aix' |
397 | 397 |
398 return 'linux' | 398 return 'linux' |
399 | 399 |
400 | 400 |
| 401 def GetHostOS(): |
| 402 """Returns flavor with no parameter overrides.""" |
| 403 return GetFlavor({}) |
| 404 |
| 405 |
401 def CopyTool(flavor, out_path): | 406 def CopyTool(flavor, out_path): |
402 """Finds (mac|sun|win)_tool.gyp in the gyp directory and copies it | 407 """Finds (mac|sun|win)_tool.gyp in the gyp directory and copies it |
403 to |out_path|.""" | 408 to |out_path|.""" |
404 prefix = { 'solaris': 'sun', 'mac': 'mac', 'win': 'win' }.get(flavor, None) | 409 prefix = { 'solaris': 'sun', 'mac': 'mac', 'win': 'win' }.get(flavor, None) |
405 if not prefix: | 410 if not prefix: |
406 return | 411 return |
407 | 412 |
408 # Slurp input file. | 413 # Slurp input file. |
409 source_path = os.path.join( | 414 source_path = os.path.join( |
410 os.path.dirname(os.path.abspath(__file__)), '%s_tool.py' % prefix) | 415 os.path.dirname(os.path.abspath(__file__)), '%s_tool.py' % prefix) |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 return | 485 return |
481 visited.add(node) | 486 visited.add(node) |
482 visiting.add(node) | 487 visiting.add(node) |
483 for neighbor in get_edges(node): | 488 for neighbor in get_edges(node): |
484 Visit(neighbor) | 489 Visit(neighbor) |
485 visiting.remove(node) | 490 visiting.remove(node) |
486 ordered_nodes.insert(0, node) | 491 ordered_nodes.insert(0, node) |
487 for node in sorted(graph): | 492 for node in sorted(graph): |
488 Visit(node) | 493 Visit(node) |
489 return ordered_nodes | 494 return ordered_nodes |
OLD | NEW |