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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 | 354 |
355 return Writer() | 355 return Writer() |
356 | 356 |
357 | 357 |
358 def GetFlavor(params): | 358 def GetFlavor(params): |
359 """Returns |params.flavor| if it's set, the system's default flavor else.""" | 359 """Returns |params.flavor| if it's set, the system's default flavor else.""" |
360 flavors = { | 360 flavors = { |
361 'cygwin': 'win', | 361 'cygwin': 'win', |
362 'win32': 'win', | 362 'win32': 'win', |
363 'darwin': 'mac', | 363 'darwin': 'mac', |
364 'sunos5': 'solaris', | |
365 'freebsd7': 'freebsd', | |
366 'freebsd8': 'freebsd', | |
367 'freebsd9': 'freebsd', | |
368 } | 364 } |
369 flavor = flavors.get(sys.platform, 'linux') | 365 |
370 return params.get('flavor', flavor) | 366 if 'flavor' in params: |
| 367 return params['flavor'] |
| 368 if sys.platform in flavors: |
| 369 return flavors[sys.platform] |
| 370 if sys.platform.startswith('sunos'): |
| 371 return 'solaris' |
| 372 if sys.platform.startswith('freebsd'): |
| 373 return 'freebsd' |
| 374 |
| 375 return 'linux' |
371 | 376 |
372 | 377 |
373 def CopyTool(flavor, out_path): | 378 def CopyTool(flavor, out_path): |
374 """Finds (mac|sun|win)_tool.gyp in the gyp directory and copies it | 379 """Finds (mac|sun|win)_tool.gyp in the gyp directory and copies it |
375 to |out_path|.""" | 380 to |out_path|.""" |
376 prefix = { 'solaris': 'sun', 'mac': 'mac', 'win': 'win' }.get(flavor, None) | 381 prefix = { 'solaris': 'sun', 'mac': 'mac', 'win': 'win' }.get(flavor, None) |
377 if not prefix: | 382 if not prefix: |
378 return | 383 return |
379 | 384 |
380 # Slurp input file. | 385 # Slurp input file. |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 return | 457 return |
453 visited.add(node) | 458 visited.add(node) |
454 visiting.add(node) | 459 visiting.add(node) |
455 for neighbor in get_edges(node): | 460 for neighbor in get_edges(node): |
456 Visit(neighbor) | 461 Visit(neighbor) |
457 visiting.remove(node) | 462 visiting.remove(node) |
458 ordered_nodes.insert(0, node) | 463 ordered_nodes.insert(0, node) |
459 for node in sorted(graph): | 464 for node in sorted(graph): |
460 Visit(node) | 465 Visit(node) |
461 return ordered_nodes | 466 return ordered_nodes |
OLD | NEW |