| 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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 | 348 |
| 349 def GetFlavor(params): | 349 def GetFlavor(params): |
| 350 """Returns |params.flavor| if it's set, the system's default flavor else.""" | 350 """Returns |params.flavor| if it's set, the system's default flavor else.""" |
| 351 flavors = { | 351 flavors = { |
| 352 'cygwin': 'win', | 352 'cygwin': 'win', |
| 353 'win32': 'win', | 353 'win32': 'win', |
| 354 'darwin': 'mac', | 354 'darwin': 'mac', |
| 355 'sunos5': 'solaris', | 355 'sunos5': 'solaris', |
| 356 'freebsd7': 'freebsd', | 356 'freebsd7': 'freebsd', |
| 357 'freebsd8': 'freebsd', | 357 'freebsd8': 'freebsd', |
| 358 'freebsd9': 'freebsd', |
| 358 } | 359 } |
| 359 flavor = flavors.get(sys.platform, 'linux') | 360 flavor = flavors.get(sys.platform, 'linux') |
| 360 return params.get('flavor', flavor) | 361 return params.get('flavor', flavor) |
| 361 | 362 |
| 362 | 363 |
| 363 def CopyTool(flavor, out_path): | 364 def CopyTool(flavor, out_path): |
| 364 """Finds (mac|sun|win)_tool.gyp in the gyp directory and copies it | 365 """Finds (mac|sun|win)_tool.gyp in the gyp directory and copies it |
| 365 to |out_path|.""" | 366 to |out_path|.""" |
| 366 prefix = { 'solaris': 'sun', 'mac': 'mac', 'win': 'win' }.get(flavor, None) | 367 prefix = { 'solaris': 'sun', 'mac': 'mac', 'win': 'win' }.get(flavor, None) |
| 367 if not prefix: | 368 if not prefix: |
| (...skipping 25 matching lines...) Expand all Loading... |
| 393 if idfun is None: | 394 if idfun is None: |
| 394 def idfun(x): return x | 395 def idfun(x): return x |
| 395 seen = {} | 396 seen = {} |
| 396 result = [] | 397 result = [] |
| 397 for item in seq: | 398 for item in seq: |
| 398 marker = idfun(item) | 399 marker = idfun(item) |
| 399 if marker in seen: continue | 400 if marker in seen: continue |
| 400 seen[marker] = 1 | 401 seen[marker] = 1 |
| 401 result.append(item) | 402 result.append(item) |
| 402 return result | 403 return result |
| OLD | NEW |