Browse Source

Fix functools decorators for older python

Blaise 4 months ago
parent
commit
11110734ee
1 changed files with 47 additions and 8 deletions
  1. 47 8
      utils/depot_tools.patch

+ 47 - 8
utils/depot_tools.patch

@@ -2,10 +2,11 @@
 #   move dotfiles into the staging directory
 #   skip cipd binary downloads
 #   replace 'src' in checkout paths with the output directory
+#   fixes functools decorators for older python
 #   ensure shallow fetches
 --- a/gclient.py
 +++ b/gclient.py
-@@ -119,8 +119,8 @@ DEPOT_TOOLS_DIR = os.path.dirname(os.pat
+@@ -121,8 +121,8 @@ DEPOT_TOOLS_DIR = os.path.dirname(os.pat
  # one, e.g. if a spec explicitly says `cache_dir = None`.)
  UNSET_CACHE_DIR = object()
  
@@ -16,7 +17,7 @@
  
  PREVIOUS_SYNC_COMMITS = 'GCLIENT_PREVIOUS_SYNC_COMMITS'
  
-@@ -413,6 +413,7 @@ class Dependency(gclient_utils.WorkItem,
+@@ -417,6 +417,7 @@ class Dependency(gclient_utils.WorkItem,
                   protocol='https',
                   git_dependencies_state=gclient_eval.DEPS,
                   print_outbuf=False):
@@ -24,7 +25,7 @@
          gclient_utils.WorkItem.__init__(self, name)
          DependencySettings.__init__(self, parent, url, managed, custom_deps,
                                      custom_vars, custom_hooks, deps_file,
-@@ -721,6 +722,7 @@ class Dependency(gclient_utils.WorkItem,
+@@ -725,6 +726,7 @@ class Dependency(gclient_utils.WorkItem,
  
              condition = dep_value.get('condition')
              dep_type = dep_value.get('dep_type')
@@ -32,7 +33,7 @@
  
              if condition and not self._get_option('process_all_deps', False):
                  if condition not in cached_conditions:
-@@ -824,6 +826,8 @@ class Dependency(gclient_utils.WorkItem,
+@@ -828,6 +830,8 @@ class Dependency(gclient_utils.WorkItem,
  
          self._gn_args_from = local_scope.get('gclient_gn_args_from')
          self._gn_args_file = local_scope.get('gclient_gn_args_file')
@@ -41,9 +42,47 @@
          self._gn_args = local_scope.get('gclient_gn_args', [])
          # It doesn't make sense to set all of these, since setting gn_args_from
          # to another DEPS will make gclient ignore any other local gn_args*
+--- a/gclient_paths.py
++++ b/gclient_paths.py
+@@ -20,7 +20,7 @@ import subprocess2
+ # pylint: disable=line-too-long
+ 
+ 
+-@functools.lru_cache
++@functools.lru_cache()
+ def FindGclientRoot(from_dir, filename='.gclient'):
+     """Tries to find the gclient root."""
+     real_from_dir = os.path.abspath(from_dir)
+@@ -67,7 +67,7 @@ def FindGclientRoot(from_dir, filename='
+     return None
+ 
+ 
+-@functools.lru_cache
++@functools.lru_cache()
+ def _GetPrimarySolutionPathInternal(cwd):
+     gclient_root = FindGclientRoot(cwd)
+     if gclient_root:
+@@ -96,7 +96,7 @@ def GetPrimarySolutionPath():
+     return _GetPrimarySolutionPathInternal(os.getcwd())
+ 
+ 
+-@functools.lru_cache
++@functools.lru_cache()
+ def _GetBuildtoolsPathInternal(cwd, override):
+     if override is not None:
+         return override
+@@ -151,7 +151,7 @@ def GetExeSuffix():
+     return ''
+ 
+ 
+-@functools.lru_cache
++@functools.lru_cache()
+ def GetGClientPrimarySolutionName(gclient_root_dir_path):
+     """Returns the name of the primary solution in the .gclient file specified."""
+     gclient_config_file = os.path.join(gclient_root_dir_path, '.gclient')
 --- a/gclient_scm.py
 +++ b/gclient_scm.py
-@@ -840,8 +840,7 @@ class GitWrapper(SCMWrapper):
+@@ -837,8 +837,7 @@ class GitWrapper(SCMWrapper):
          self._SetFetchConfig(options)
  
          # Fetch upstream if we don't already have |revision|.
@@ -53,7 +92,7 @@
              self._Fetch(options, prune=options.force)
  
              if not scm.GIT.IsValidRevision(
-@@ -857,7 +856,7 @@ class GitWrapper(SCMWrapper):
+@@ -854,7 +853,7 @@ class GitWrapper(SCMWrapper):
  
          # This is a big hammer, debatable if it should even be here...
          if options.force or options.reset:
@@ -62,7 +101,7 @@
              if options.upstream and upstream_branch:
                  target = upstream_branch
              self._Scrub(target, options)
-@@ -872,7 +871,6 @@ class GitWrapper(SCMWrapper):
+@@ -869,7 +868,6 @@ class GitWrapper(SCMWrapper):
              # to the checkout step.
              if not (options.force or options.reset):
                  self._CheckClean(revision)
@@ -70,7 +109,7 @@
              if self._Capture(['rev-list', '-n', '1', 'HEAD']) == revision:
                  self.Print('Up-to-date; skipping checkout.')
              else:
-@@ -1587,8 +1585,7 @@ class GitWrapper(SCMWrapper):
+@@ -1545,8 +1543,7 @@ class GitWrapper(SCMWrapper):
              fetch_cmd.append('--no-tags')
          elif quiet:
              fetch_cmd.append('--quiet')