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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 # Eval the content. | 448 # Eval the content. |
449 try: | 449 try: |
450 exec(deps_content, global_scope, local_scope) | 450 exec(deps_content, global_scope, local_scope) |
451 except SyntaxError, e: | 451 except SyntaxError, e: |
452 gclient_utils.SyntaxErrorToError(filepath, e) | 452 gclient_utils.SyntaxErrorToError(filepath, e) |
453 deps = local_scope.get('deps', {}) | 453 deps = local_scope.get('deps', {}) |
454 if 'recursion' in local_scope: | 454 if 'recursion' in local_scope: |
455 self.recursion_override = local_scope.get('recursion') | 455 self.recursion_override = local_scope.get('recursion') |
456 logging.warning( | 456 logging.warning( |
457 'Setting %s recursion to %d.', self.name, self.recursion_limit) | 457 'Setting %s recursion to %d.', self.name, self.recursion_limit) |
| 458 # Check if 'target_os' is present in the DEPS file. If yes, then add OSes |
| 459 # specified to the set of enforced OSes. |
| 460 if 'target_os' in local_scope: |
| 461 self.root._enforced_os = tuple( |
| 462 set(local_scope['target_os']).union(self.root._enforced_os)) |
458 # load os specific dependencies if defined. these dependencies may | 463 # load os specific dependencies if defined. these dependencies may |
459 # override or extend the values defined by the 'deps' member. | 464 # override or extend the values defined by the 'deps' member. |
460 if 'deps_os' in local_scope: | 465 if 'deps_os' in local_scope: |
461 enforced_os = self.root.enforced_os | 466 enforced_os = self.root.enforced_os |
462 for deps_os_key in enforced_os: | 467 for deps_os_key in enforced_os: |
463 os_deps = local_scope['deps_os'].get(deps_os_key, {}) | 468 os_deps = local_scope['deps_os'].get(deps_os_key, {}) |
464 if len(enforced_os) > 1: | 469 if len(enforced_os) > 1: |
465 # Ignore any conflict when including deps for more than one | 470 # Ignore any conflict when including deps for more than one |
466 # platform, so we collect the broadest set of dependencies | 471 # platform, so we collect the broadest set of dependencies |
467 # available. We may end up with the wrong revision of something for | 472 # available. We may end up with the wrong revision of something for |
(...skipping 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1643 except (gclient_utils.Error, subprocess2.CalledProcessError), e: | 1648 except (gclient_utils.Error, subprocess2.CalledProcessError), e: |
1644 print >> sys.stderr, 'Error: %s' % str(e) | 1649 print >> sys.stderr, 'Error: %s' % str(e) |
1645 return 1 | 1650 return 1 |
1646 | 1651 |
1647 | 1652 |
1648 if '__main__' == __name__: | 1653 if '__main__' == __name__: |
1649 fix_encoding.fix_encoding() | 1654 fix_encoding.fix_encoding() |
1650 sys.exit(Main(sys.argv[1:])) | 1655 sys.exit(Main(sys.argv[1:])) |
1651 | 1656 |
1652 # vim: ts=2:sw=2:tw=80:et: | 1657 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |