| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 self.local_target_os = None | 184 self.local_target_os = None |
| 185 | 185 |
| 186 # These are only set in .gclient and not in DEPS files. | 186 # These are only set in .gclient and not in DEPS files. |
| 187 self._custom_vars = custom_vars or {} | 187 self._custom_vars = custom_vars or {} |
| 188 self._custom_deps = custom_deps or {} | 188 self._custom_deps = custom_deps or {} |
| 189 | 189 |
| 190 # TODO(iannucci): Remove this when all masters are correctly substituting | 190 # TODO(iannucci): Remove this when all masters are correctly substituting |
| 191 # the new blink url. | 191 # the new blink url. |
| 192 if (self._custom_vars.get('webkit_trunk', '') == | 192 if (self._custom_vars.get('webkit_trunk', '') == |
| 193 'svn://svn-mirror.golo.chromium.org/webkit-readonly/trunk'): | 193 'svn://svn-mirror.golo.chromium.org/webkit-readonly/trunk'): |
| 194 self._custom_vars['webkit_trunk'] = ( | 194 new_url = 'svn://svn-mirror.golo.chromium.org/blink/trunk' |
| 195 'svn://svn-mirror.golo.chromium.org/blink/trunk') | 195 print 'Overwriting Var("webkit_trunk") with %s' % new_url |
| 196 self._custom_vars['webkit_trunk'] = new_url |
| 196 | 197 |
| 197 # Post process the url to remove trailing slashes. | 198 # Post process the url to remove trailing slashes. |
| 198 if isinstance(self._url, basestring): | 199 if isinstance(self._url, basestring): |
| 199 # urls are sometime incorrectly written as proto://host/path/@rev. Replace | 200 # urls are sometime incorrectly written as proto://host/path/@rev. Replace |
| 200 # it to proto://host/path@rev. | 201 # it to proto://host/path@rev. |
| 201 self._url = self._url.replace('/@', '@') | 202 self._url = self._url.replace('/@', '@') |
| 202 elif not isinstance(self._url, | 203 elif not isinstance(self._url, |
| 203 (self.FromImpl, self.FileImpl, None.__class__)): | 204 (self.FromImpl, self.FileImpl, None.__class__)): |
| 204 raise gclient_utils.Error( | 205 raise gclient_utils.Error( |
| 205 ('dependency url must be either a string, None, ' | 206 ('dependency url must be either a string, None, ' |
| (...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1432 dependencies, and performs minimal postprocessing of the output. The | 1433 dependencies, and performs minimal postprocessing of the output. The |
| 1433 resulting patch is printed to stdout and can be applied to a freshly | 1434 resulting patch is printed to stdout and can be applied to a freshly |
| 1434 checked out tree via 'patch -p0 < patchfile'. | 1435 checked out tree via 'patch -p0 < patchfile'. |
| 1435 """ | 1436 """ |
| 1436 parser.add_option('--deps', dest='deps_os', metavar='OS_LIST', | 1437 parser.add_option('--deps', dest='deps_os', metavar='OS_LIST', |
| 1437 help='override deps for the specified (comma-separated) ' | 1438 help='override deps for the specified (comma-separated) ' |
| 1438 'platform(s); \'all\' will process all deps_os ' | 1439 'platform(s); \'all\' will process all deps_os ' |
| 1439 'references') | 1440 'references') |
| 1440 parser.remove_option('--jobs') | 1441 parser.remove_option('--jobs') |
| 1441 (options, args) = parser.parse_args(args) | 1442 (options, args) = parser.parse_args(args) |
| 1442 # Force jobs to 1 so the stdout is not annotated with the thread ids | 1443 # Force jobs to 1 so the stdout is not annotated with the thread ids |
| 1443 options.jobs = 1 | 1444 options.jobs = 1 |
| 1444 client = GClient.LoadCurrentConfig(options) | 1445 client = GClient.LoadCurrentConfig(options) |
| 1445 if not client: | 1446 if not client: |
| 1446 raise gclient_utils.Error('client not configured; see \'gclient config\'') | 1447 raise gclient_utils.Error('client not configured; see \'gclient config\'') |
| 1447 if options.verbose: | 1448 if options.verbose: |
| 1448 # Print out the .gclient file. This is longer than if we just printed the | 1449 # Print out the .gclient file. This is longer than if we just printed the |
| 1449 # client dict, but more legible, and it might contain helpful comments. | 1450 # client dict, but more legible, and it might contain helpful comments. |
| 1450 print(client.config_content) | 1451 print(client.config_content) |
| 1451 return client.RunOnDeps('pack', args) | 1452 return client.RunOnDeps('pack', args) |
| 1452 | 1453 |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1774 except (gclient_utils.Error, subprocess2.CalledProcessError), e: | 1775 except (gclient_utils.Error, subprocess2.CalledProcessError), e: |
| 1775 print >> sys.stderr, 'Error: %s' % str(e) | 1776 print >> sys.stderr, 'Error: %s' % str(e) |
| 1776 return 1 | 1777 return 1 |
| 1777 | 1778 |
| 1778 | 1779 |
| 1779 if '__main__' == __name__: | 1780 if '__main__' == __name__: |
| 1780 fix_encoding.fix_encoding() | 1781 fix_encoding.fix_encoding() |
| 1781 sys.exit(Main(sys.argv[1:])) | 1782 sys.exit(Main(sys.argv[1:])) |
| 1782 | 1783 |
| 1783 # vim: ts=2:sw=2:tw=80:et: | 1784 # vim: ts=2:sw=2:tw=80:et: |
| OLD | NEW |