Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(366)

Unified Diff: gclient.py

Issue 385123008: Update recursedeps to support use_relative_path. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: update comment Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/gclient_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient.py
diff --git a/gclient.py b/gclient.py
index a2d159a2c38445d3c9e49ccebc4bcdcde2810252..b60884a0c2742bd55b43f01ddc5e5380af216bff 100755
--- a/gclient.py
+++ b/gclient.py
@@ -595,6 +595,7 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
'Setting %s recursion to %d.', self.name, self.recursion_limit)
self.recursedeps = local_scope.get('recursedeps', None)
if 'recursedeps' in local_scope:
+ self.recursedeps = set(self.recursedeps)
logging.warning('Found recursedeps %r.', repr(self.recursedeps))
# If present, save 'target_os' in the local_target_os property.
if 'target_os' in local_scope:
@@ -613,16 +614,27 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
# If use_relative_paths is set in the DEPS file, regenerate
# the dictionary using paths relative to the directory containing
- # the DEPS file.
+ # the DEPS file. Also update recursedeps if use_relative_paths is
+ # enabled.
use_relative_paths = local_scope.get('use_relative_paths', False)
if use_relative_paths:
+ logging.warning('use_relative_paths enabled.')
rel_deps = {}
for d, url in deps.items():
# normpath is required to allow DEPS to use .. in their
# dependency local path.
rel_deps[os.path.normpath(os.path.join(self.name, d))] = url
+ logging.warning('Updating deps by prepending %s.', self.name)
deps = rel_deps
+ # Update recursedeps if it's set.
+ if self.recursedeps is not None:
+ logging.warning('Updating recursedeps by prepending %s.', self.name)
+ rel_deps = set()
+ for d in self.recursedeps:
+ rel_deps.add(os.path.normpath(os.path.join(self.name, d)))
+ self.recursedeps = rel_deps
+
# Convert the deps into real Dependency.
deps_to_add = []
for name, url in deps.iteritems():
« no previous file with comments | « no previous file | tests/gclient_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698