OLD | NEW |
1 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 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 import base64 | 5 import base64 |
6 import json | 6 import json |
7 import os | 7 import os |
| 8 import re |
8 import time | 9 import time |
9 import urllib2 | 10 import urllib2 |
10 | 11 |
11 from common import utils | 12 from common import utils |
12 | 13 |
13 | 14 |
14 _THIS_DIR = os.path.abspath(os.path.dirname(__file__)) | 15 _THIS_DIR = os.path.abspath(os.path.dirname(__file__)) |
15 CONFIG = json.loads(open(os.path.join(_THIS_DIR, | 16 CONFIG = json.loads(open(os.path.join(_THIS_DIR, |
16 'deps_config.json'), 'r').read()) | 17 'deps_config.json'), 'r').read()) |
| 18 OLD_GIT_URL_PATTERN = re.compile(r'https?://git.chromium.org/(.*)') |
17 | 19 |
18 | 20 |
19 class _VarImpl(object): | 21 class _VarImpl(object): |
20 | 22 |
21 def __init__(self, local_scope): | 23 def __init__(self, local_scope): |
22 self._local_scope = local_scope | 24 self._local_scope = local_scope |
23 | 25 |
24 def Lookup(self, var_name): | 26 def Lookup(self, var_name): |
25 if var_name in self._local_scope.get('vars', {}): | 27 if var_name in self._local_scope.get('vars', {}): |
26 return self._local_scope['vars'][var_name] | 28 return self._local_scope['vars'][var_name] |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 # Figure out components based on the dependencies. | 142 # Figure out components based on the dependencies. |
141 components = {} | 143 components = {} |
142 host_dirs = CONFIG['host_directories'] | 144 host_dirs = CONFIG['host_directories'] |
143 for component_path, component_repo_url in all_deps.iteritems(): | 145 for component_path, component_repo_url in all_deps.iteritems(): |
144 if component_repo_url is None: | 146 if component_repo_url is None: |
145 # For some platform like iso, some component is ignored. | 147 # For some platform like iso, some component is ignored. |
146 continue | 148 continue |
147 | 149 |
148 name = _GetComponentName(component_path, host_dirs) | 150 name = _GetComponentName(component_path, host_dirs) |
149 repository, revision = component_repo_url.split('@') | 151 repository, revision = component_repo_url.split('@') |
| 152 match = OLD_GIT_URL_PATTERN.match(repository) |
| 153 if match: |
| 154 repository = 'https://chromium.googlesource.com/%s' % match.group(1) |
150 is_git_hash = utils.IsGitHash(revision) | 155 is_git_hash = utils.IsGitHash(revision) |
151 if is_git_hash: | 156 if is_git_hash: |
152 repository_type = 'git' | 157 repository_type = 'git' |
153 else: | 158 else: |
154 repository_type = 'svn' | 159 repository_type = 'svn' |
155 if not component_path.endswith('/'): | 160 if not component_path.endswith('/'): |
156 component_path += '/' | 161 component_path += '/' |
157 components[component_path] = { | 162 components[component_path] = { |
158 'path': component_path, | 163 'path': component_path, |
159 'name': name, | 164 'name': name, |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 'path': path, | 216 'path': path, |
212 'rolled': new_component['revision'] != old_revision, | 217 'rolled': new_component['revision'] != old_revision, |
213 'name': new_component['name'], | 218 'name': new_component['name'], |
214 'old_revision': old_revision, | 219 'old_revision': old_revision, |
215 'new_revision': new_component['revision'], | 220 'new_revision': new_component['revision'], |
216 'repository': new_component['repository'], | 221 'repository': new_component['repository'], |
217 'repository_type': new_component['repository_type'] | 222 'repository_type': new_component['repository_type'] |
218 } | 223 } |
219 | 224 |
220 return components | 225 return components |
OLD | NEW |