Chromium Code Reviews| Index: build/download_nacl_irt.py |
| diff --git a/build/download_nacl_irt.py b/build/download_nacl_irt.py |
| index a799b8ee023beb8bd6daddad5b5593a47f674aec..df84b463126ef5ff2c1dde8982cf0085088a66c5 100644 |
| --- a/build/download_nacl_irt.py |
| +++ b/build/download_nacl_irt.py |
| @@ -119,6 +119,12 @@ def DownloadFileWithRetry(dest_path, url): |
| time.sleep(1) |
| +def EvalDepsFile(path): |
| + scope = {'Var': lambda name: scope['vars'][name]} |
| + execfile(path, {}, scope) |
| + return scope |
| + |
| + |
| def Main(): |
| parser = optparse.OptionParser() |
| parser.add_option( |
| @@ -143,6 +149,18 @@ def Main(): |
| if len(args) != 0: |
| parser.error('Unexpected arguments: %r' % args) |
| + if options.nacl_revision is None and len(options.file_hashes) == 0: |
| + # The script must have been invoked directly with no arguments, |
| + # rather than being invoked by gclient. In this case, read the |
| + # DEPS file ourselves rather than having gclient pass us values |
| + # from DEPS. |
| + deps_data = EvalDepsFile(os.path.join('src', 'DEPS')) |
|
Paweł Hajdan Jr.
2011/05/09 14:08:48
This is duplicating some gclient code and it's rel
|
| + options.nacl_revision = deps_data['vars']['nacl_revision'] |
| + options.file_hashes = [ |
| + ('x86_32', deps_data['vars']['nacl_irt_hash_x86_32']), |
| + ('x86_64', deps_data['vars']['nacl_irt_hash_x86_64']), |
| + ] |
| + |
| nacl_dir = os.path.join('src', 'native_client') |
| if not os.path.exists(nacl_dir): |
| # If "native_client" is not present, this might be because the |