depot_tools.patch 3.9 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. @@ -125,8 +125,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. @@ -421,6 +421,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. @@ -729,6 +730,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. @@ -845,6 +847,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. @@ -844,8 +844,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. @@ -861,7 +860,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. @@ -876,7 +875,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 self._Capture(['rev-list', '-n', '1', 'HEAD']) == revision:
  63. self.Print('Up-to-date; skipping checkout.')
  64. else:
  65. @@ -1550,8 +1548,7 @@ class GitWrapper(SCMWrapper):
  66. fetch_cmd.append('--no-tags')
  67. elif quiet:
  68. fetch_cmd.append('--quiet')
  69. - if depth:
  70. - fetch_cmd.append('--depth=' + str(depth))
  71. + fetch_cmd.append('--depth=1')
  72. self._Run(fetch_cmd, options, show_header=options.verbose, retry=True)
  73. def _SetFetchConfig(self, options):
  74. --- a/gsutil.py
  75. +++ b/gsutil.py
  76. @@ -27,7 +27,7 @@ DEFAULT_BIN_DIR = os.path.join(THIS_DIR,
  77. IS_WINDOWS = os.name == 'nt'
  78. -VERSION = '4.68'
  79. +VERSION = '5.28'
  80. # Google OAuth Context required by gsutil.
  81. LUCI_AUTH_SCOPES = [