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

Unified Diff: tools/git-sync-deps

Issue 494713005: git-sync-deps: handle recursion and deps_os at the same time (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: comments from mtklein Created 6 years, 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/git-sync-deps
diff --git a/tools/git-sync-deps b/tools/git-sync-deps
index 717ab38055287dc2af9a0bdb4c814fcdca51fb79..4a0ded1f828d7299be914a1563ebca86dd2816ce 100755
--- a/tools/git-sync-deps
+++ b/tools/git-sync-deps
@@ -154,7 +154,7 @@ class DepsError(Exception):
pass
-def git_sync_deps(deps_file_path, deps_os_list, verbose):
+def git_sync_deps(deps_file_path, command_line_os_requests, verbose):
"""Grab dependencies, with optional platform support.
Args:
@@ -170,16 +170,13 @@ def git_sync_deps(deps_file_path, deps_os_list, verbose):
assert git
deps_file_directory = os.path.dirname(deps_file_path)
- deps = parse_file_to_dict(deps_file_path)
- dependencies = deps['deps'].copy()
- for deps_os in deps_os_list:
+ deps_file = parse_file_to_dict(deps_file_path)
+ dependencies = deps_file['deps'].copy()
+ os_specific_dependencies = deps_file.get('deps_os', [])
+ for os_name in command_line_os_requests:
# Add OS-specific dependencies
- if deps_os not in deps['deps_os']:
- raise DepsError(
- 'Argument "%s" not found within deps_os keys %r' %
- (deps_os, deps['deps_os'].keys()))
- for dep in deps['deps_os'][deps_os]:
- dependencies[dep] = deps['deps_os'][deps_os][dep]
+ if os_name in os_specific_dependencies:
+ dependencies.update(os_specific_dependencies[os_name])
list_of_arg_lists = []
for directory in dependencies:
if '@' in dependencies[directory]:
@@ -194,9 +191,9 @@ def git_sync_deps(deps_file_path, deps_os_list, verbose):
multithread(git_checkout_to_directory, list_of_arg_lists)
- for directory in deps.get('recursedeps', []):
+ for directory in deps_file.get('recursedeps', []):
recursive_path = os.path.join(deps_file_directory, directory, 'DEPS')
- git_sync_deps(recursive_path, deps_os_list, verbose)
+ git_sync_deps(recursive_path, command_line_os_requests, verbose)
def multithread(function, list_of_arg_lists):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698