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

Side by Side Diff: appengine/findit/common/deps_parser.py

Issue 1950123003: [Findit] Fetch DEPS from buildspec/ instead of trunk for chrome official builds. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Update doc string. Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « appengine/findit/common/dependency.py ('k') | appengine/findit/common/http_client_appengine.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """ This is an incomplete implementation of a DEPS file parser. 5 """ This is an incomplete implementation of a DEPS file parser.
6 6
7 Now only keys 'vars', 'deps', and 'deps_os' are taken care of. 7 Now only keys 'vars', 'deps', and 'deps_os' are taken care of.
8 8
9 TODO: support strict mode, 'target_os', 'target_os_only', 'use_relative_paths', 9 TODO: support strict mode, 'target_os', 'target_os_only', 'use_relative_paths',
10 both forms of recursion, both forms of hooks, 'allowed_hosts', etc. 10 both forms of recursion, both forms of hooks, 'allowed_hosts', etc.
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 os_name = target_os.lower() 159 os_name = target_os.lower()
160 assert os_name in DEPS_OS_CHOICES, 'Target OS "%s" is invalid' % os_name 160 assert os_name in DEPS_OS_CHOICES, 'Target OS "%s" is invalid' % os_name
161 return os_name 161 return os_name
162 162
163 if 'all' in target_os_list: 163 if 'all' in target_os_list:
164 target_os_list = DEPS_OS_CHOICES 164 target_os_list = DEPS_OS_CHOICES
165 else: 165 else:
166 target_os_list = [_NormalizeTargetOSName(name) for name in target_os_list] 166 target_os_list = [_NormalizeTargetOSName(name) for name in target_os_list]
167 167
168 deps_content = deps_loader.Load( 168 deps_content = deps_loader.Load(
169 root_dep.repo_url, root_dep.revision, root_dep.deps_file) 169 root_dep.deps_repo_url, root_dep.deps_repo_revision, root_dep.deps_file)
170 deps, deps_os = ParseDEPSContent(deps_content, keys=('deps', 'deps_os')) 170 deps, deps_os = ParseDEPSContent(deps_content, keys=('deps', 'deps_os'))
171 171
172 all_deps = MergeWithOsDeps(deps, deps_os, target_os_list) 172 all_deps = MergeWithOsDeps(deps, deps_os, target_os_list)
173 173
174 def _CreateDependency(path, repo_info): 174 def _CreateDependency(path, repo_info):
175 if not path.endswith('/'): 175 if not path.endswith('/'):
176 path = path + '/' 176 path = path + '/'
177 177
178 repo_url = repo_info 178 repo_url = repo_info
179 revision = None 179 revision = None
180 if '@' in repo_info: 180 if '@' in repo_info:
181 # The dependency is pinned to some revision. 181 # The dependency is pinned to some revision.
182 repo_url, revision = repo_info.split('@') 182 repo_url, revision = repo_info.split('@')
183 183
184 return dependency.Dependency( 184 return dependency.Dependency(
185 path, repo_url, revision, root_dep.deps_file) 185 path, repo_url, revision, root_dep.deps_file)
186 186
187 for path, repo_info in all_deps.iteritems(): 187 for path, repo_info in all_deps.iteritems():
188 if repo_info is None: 188 if repo_info is None:
189 # The dependency is not needed for all the target os. 189 # The dependency is not needed for all the target os.
190 continue 190 continue
191 191
192 sub_dep = _CreateDependency(path, repo_info) 192 sub_dep = _CreateDependency(path, repo_info)
193 sub_dep.SetParent(root_dep) 193 sub_dep.SetParent(root_dep)
194 194
195 # TODO: go into the next level of dependency if needed. 195 # TODO: go into the next level of dependency if needed.
OLDNEW
« no previous file with comments | « appengine/findit/common/dependency.py ('k') | appengine/findit/common/http_client_appengine.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698