OLD | NEW |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2010 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 """A wrapper script to manage a set of client modules in different SCM. | 6 """A wrapper script to manage a set of client modules in different SCM. |
7 | 7 |
8 This script is intended to be used to help basic management of client | 8 This script is intended to be used to help basic management of client |
9 program sources residing in one or more Subversion modules and Git | 9 program sources residing in one or more Subversion modules and Git |
10 repositories, along with other modules it depends on, also in Subversion or Git, | 10 repositories, along with other modules it depends on, also in Subversion or Git, |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
366 dir. | 366 dir. |
367 | 367 |
368 Returns: | 368 Returns: |
369 A dict representing the contents of the .gclient file or an empty dict if | 369 A dict representing the contents of the .gclient file or an empty dict if |
370 the .gclient file doesn't exist. | 370 the .gclient file doesn't exist. |
371 """ | 371 """ |
372 if not from_dir: | 372 if not from_dir: |
373 from_dir = os.curdir | 373 from_dir = os.curdir |
374 path = os.path.realpath(from_dir) | 374 path = os.path.realpath(from_dir) |
375 while not os.path.exists(os.path.join(path, options.config_filename)): | 375 while not os.path.exists(os.path.join(path, options.config_filename)): |
376 next = os.path.split(path) | 376 split_path = os.path.split(path) |
377 if not next[1]: | 377 if not split_path[1]: |
378 return None | 378 return None |
379 path = next[0] | 379 path = split_path[0] |
380 client = GClient(path, options) | 380 client = GClient(path, options) |
381 client._LoadConfig() | 381 client._LoadConfig() |
382 return client | 382 return client |
383 | 383 |
384 def SetDefaultConfig(self, solution_name, solution_url, safesync_url): | 384 def SetDefaultConfig(self, solution_name, solution_url, safesync_url): |
385 self.SetConfig(DEFAULT_CLIENT_FILE_TEXT % { | 385 self.SetConfig(DEFAULT_CLIENT_FILE_TEXT % { |
386 'solution_name': solution_name, | 386 'solution_name': solution_name, |
387 'solution_url': solution_url, | 387 'solution_url': solution_url, |
388 'safesync_url' : safesync_url, | 388 'safesync_url' : safesync_url, |
389 }) | 389 }) |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
472 "darwin": "mac", | 472 "darwin": "mac", |
473 "mac": "mac", | 473 "mac": "mac", |
474 "unix": "unix", | 474 "unix": "unix", |
475 "linux": "unix", | 475 "linux": "unix", |
476 "linux2": "unix", | 476 "linux2": "unix", |
477 } | 477 } |
478 | 478 |
479 if self._options.deps_os is not None: | 479 if self._options.deps_os is not None: |
480 deps_to_include = self._options.deps_os.split(",") | 480 deps_to_include = self._options.deps_os.split(",") |
481 if "all" in deps_to_include: | 481 if "all" in deps_to_include: |
482 deps_to_include = deps_os_choices.values() | 482 deps_to_include = list(set(deps_os_choices.itervalues())) |
M-A Ruel
2010/03/11 15:29:40
Removes duplicate entries.
| |
483 else: | 483 else: |
484 deps_to_include = [deps_os_choices.get(self._options.platform, "unix")] | 484 deps_to_include = [deps_os_choices.get(self._options.platform, "unix")] |
485 | 485 |
486 deps_to_include = set(deps_to_include) | 486 deps_to_include = set(deps_to_include) |
487 for deps_os_key in deps_to_include: | 487 for deps_os_key in deps_to_include: |
488 os_deps = local_scope["deps_os"].get(deps_os_key, {}) | 488 os_deps = local_scope["deps_os"].get(deps_os_key, {}) |
489 if len(deps_to_include) > 1: | 489 if len(deps_to_include) > 1: |
490 # Ignore any overrides when including deps for more than one | 490 # Ignore any overrides when including deps for more than one |
491 # platform, so we collect the broadest set of dependencies available. | 491 # platform, so we collect the broadest set of dependencies available. |
492 # We may end up with the wrong revision of something for our | 492 # We may end up with the wrong revision of something for our |
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1247 | 1247 |
1248 if "__main__" == __name__: | 1248 if "__main__" == __name__: |
1249 try: | 1249 try: |
1250 result = Main(sys.argv) | 1250 result = Main(sys.argv) |
1251 except gclient_utils.Error, e: | 1251 except gclient_utils.Error, e: |
1252 print >> sys.stderr, "Error: %s" % str(e) | 1252 print >> sys.stderr, "Error: %s" % str(e) |
1253 result = 1 | 1253 result = 1 |
1254 sys.exit(result) | 1254 sys.exit(result) |
1255 | 1255 |
1256 # vim: ts=2:sw=2:tw=80:et: | 1256 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |