| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium 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 """Meta checkout manager supporting both Subversion and GIT. | 6 """Meta checkout manager supporting both Subversion and GIT. |
| 7 | 7 |
| 8 Files | 8 Files |
| 9 .gclient : Current client configuration, written by 'config' command. | 9 .gclient : Current client configuration, written by 'config' command. |
| 10 Format is a Python script defining 'solutions', a list whose | 10 Format is a Python script defining 'solutions', a list whose |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 deps = local_scope.get('deps', {}) | 470 deps = local_scope.get('deps', {}) |
| 471 if 'recursion' in local_scope: | 471 if 'recursion' in local_scope: |
| 472 self.recursion_override = local_scope.get('recursion') | 472 self.recursion_override = local_scope.get('recursion') |
| 473 logging.warning( | 473 logging.warning( |
| 474 'Setting %s recursion to %d.', self.name, self.recursion_limit) | 474 'Setting %s recursion to %d.', self.name, self.recursion_limit) |
| 475 # If present, save 'target_os' in the local_target_os property. | 475 # If present, save 'target_os' in the local_target_os property. |
| 476 if 'target_os' in local_scope: | 476 if 'target_os' in local_scope: |
| 477 self.local_target_os = local_scope['target_os'] | 477 self.local_target_os = local_scope['target_os'] |
| 478 # load os specific dependencies if defined. these dependencies may | 478 # load os specific dependencies if defined. these dependencies may |
| 479 # override or extend the values defined by the 'deps' member. | 479 # override or extend the values defined by the 'deps' member. |
| 480 target_os_deps = {} |
| 480 if 'deps_os' in local_scope: | 481 if 'deps_os' in local_scope: |
| 481 for deps_os_key in self.target_os: | 482 for deps_os_key in self.target_os: |
| 482 os_deps = local_scope['deps_os'].get(deps_os_key, {}) | 483 os_deps = local_scope['deps_os'].get(deps_os_key, {}) |
| 483 if len(self.target_os) > 1: | 484 if len(self.target_os) > 1: |
| 484 # Ignore any conflict when including deps for more than one | 485 # Ignore any conflict when including deps for more than one |
| 485 # platform, so we collect the broadest set of dependencies | 486 # platform, so we collect the broadest set of dependencies |
| 486 # available. We may end up with the wrong revision of something for | 487 # available. We may end up with the wrong revision of something for |
| 487 # our platform, but this is the best we can do. | 488 # our platform, but this is the best we can do. |
| 488 deps.update([x for x in os_deps.items() if not x[0] in deps]) | 489 target_os_deps.update( |
| 490 [x for x in os_deps.items() if not x[0] in target_os_deps]) |
| 489 else: | 491 else: |
| 490 deps.update(os_deps) | 492 target_os_deps.update(os_deps) |
| 493 |
| 494 # deps_os overrides paths from deps |
| 495 deps.update(target_os_deps) |
| 491 | 496 |
| 492 # If a line is in custom_deps, but not in the solution, we want to append | 497 # If a line is in custom_deps, but not in the solution, we want to append |
| 493 # this line to the solution. | 498 # this line to the solution. |
| 494 for d in self.custom_deps: | 499 for d in self.custom_deps: |
| 495 if d not in deps: | 500 if d not in deps: |
| 496 deps[d] = self.custom_deps[d] | 501 deps[d] = self.custom_deps[d] |
| 497 | 502 |
| 498 # If use_relative_paths is set in the DEPS file, regenerate | 503 # If use_relative_paths is set in the DEPS file, regenerate |
| 499 # the dictionary using paths relative to the directory containing | 504 # the dictionary using paths relative to the directory containing |
| 500 # the DEPS file. | 505 # the DEPS file. |
| (...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1673 except (gclient_utils.Error, subprocess2.CalledProcessError), e: | 1678 except (gclient_utils.Error, subprocess2.CalledProcessError), e: |
| 1674 print >> sys.stderr, 'Error: %s' % str(e) | 1679 print >> sys.stderr, 'Error: %s' % str(e) |
| 1675 return 1 | 1680 return 1 |
| 1676 | 1681 |
| 1677 | 1682 |
| 1678 if '__main__' == __name__: | 1683 if '__main__' == __name__: |
| 1679 fix_encoding.fix_encoding() | 1684 fix_encoding.fix_encoding() |
| 1680 sys.exit(Main(sys.argv[1:])) | 1685 sys.exit(Main(sys.argv[1:])) |
| 1681 | 1686 |
| 1682 # vim: ts=2:sw=2:tw=80:et: | 1687 # vim: ts=2:sw=2:tw=80:et: |
| OLD | NEW |