depot_tools.patch 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # Changes to gclient that:
  2. # move dotfiles into the staging directory
  3. # skip cipd binary downloads
  4. # replace 'src' in checkout paths with the output directory
  5. # ensure shallow fetches
  6. # utilize a newer version of gsutil to support later versions of python
  7. --- a/gclient.py
  8. +++ b/gclient.py
  9. @@ -126,8 +126,8 @@ DEPOT_TOOLS_DIR = os.path.dirname(os.pat
  10. # one, e.g. if a spec explicitly says `cache_dir = None`.)
  11. UNSET_CACHE_DIR = object()
  12. -PREVIOUS_CUSTOM_VARS_FILE = '.gclient_previous_custom_vars'
  13. -PREVIOUS_SYNC_COMMITS_FILE = '.gclient_previous_sync_commits'
  14. +PREVIOUS_CUSTOM_VARS_FILE = r'UC_STAGING'+os.sep+'.gclient_previous_custom_vars'
  15. +PREVIOUS_SYNC_COMMITS_FILE = r'UC_STAGING'+os.sep+'.gclient_previous_sync_commits'
  16. PREVIOUS_SYNC_COMMITS = 'GCLIENT_PREVIOUS_SYNC_COMMITS'
  17. @@ -424,6 +424,7 @@ class Dependency(gclient_utils.WorkItem,
  18. protocol='https',
  19. git_dependencies_state=gclient_eval.DEPS,
  20. print_outbuf=False):
  21. + if name and name[0:3] == "src": name = r"UC_OUT"+name[3:]
  22. gclient_utils.WorkItem.__init__(self, name)
  23. DependencySettings.__init__(self, parent, url, managed, custom_deps,
  24. custom_vars, custom_hooks, deps_file,
  25. @@ -745,6 +746,7 @@ class Dependency(gclient_utils.WorkItem,
  26. condition = dep_value.get('condition')
  27. dep_type = dep_value.get('dep_type')
  28. + if dep_type == 'cipd': continue
  29. if condition and not self._get_option('process_all_deps', False):
  30. if condition not in cached_conditions:
  31. @@ -877,6 +879,8 @@ class Dependency(gclient_utils.WorkItem,
  32. self._gn_args_from = local_scope.get('gclient_gn_args_from')
  33. self._gn_args_file = local_scope.get('gclient_gn_args_file')
  34. + if self._gn_args_file and self._gn_args_file[0:3] == "src":
  35. + self._gn_args_file = r"UC_OUT"+self._gn_args_file[3:]
  36. self._gn_args = local_scope.get('gclient_gn_args', [])
  37. # It doesn't make sense to set all of these, since setting gn_args_from
  38. # to another DEPS will make gclient ignore any other local gn_args*
  39. --- a/gclient_scm.py
  40. +++ b/gclient_scm.py
  41. @@ -929,8 +929,7 @@ class GitWrapper(SCMWrapper):
  42. self._SetFetchConfig(options)
  43. # Fetch upstream if we don't already have |revision|.
  44. - if not scm.GIT.IsValidRevision(
  45. - self.checkout_path, revision, sha_only=True):
  46. + if False:
  47. self._Fetch(options, prune=options.force)
  48. if not scm.GIT.IsValidRevision(
  49. @@ -946,7 +945,7 @@ class GitWrapper(SCMWrapper):
  50. # This is a big hammer, debatable if it should even be here...
  51. if options.force or options.reset:
  52. - target = 'HEAD'
  53. + target = 'FETCH_HEAD'
  54. if options.upstream and upstream_branch:
  55. target = upstream_branch
  56. self._Scrub(target, options)
  57. @@ -961,7 +960,6 @@ class GitWrapper(SCMWrapper):
  58. # to the checkout step.
  59. if not (options.force or options.reset):
  60. self._CheckClean(revision)
  61. - self._CheckDetachedHead(revision, options)
  62. if not current_revision:
  63. current_revision = self._Capture(
  64. @@ -1641,8 +1639,7 @@ class GitWrapper(SCMWrapper):
  65. fetch_cmd.append('--no-tags')
  66. elif quiet:
  67. fetch_cmd.append('--quiet')
  68. - if depth:
  69. - fetch_cmd.append('--depth=' + str(depth))
  70. + fetch_cmd.append('--depth=1')
  71. self._Run(fetch_cmd, options, show_header=options.verbose, retry=True)
  72. def _SetFetchConfig(self, options):
  73. --- a/gsutil.py
  74. +++ b/gsutil.py
  75. @@ -25,7 +25,7 @@ DEFAULT_BIN_DIR = os.path.join(THIS_DIR,
  76. IS_WINDOWS = os.name == 'nt'
  77. -VERSION = '4.68'
  78. +VERSION = '5.28'
  79. # Google OAuth Context required by gsutil.
  80. LUCI_AUTH_SCOPES = [