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

Unified Diff: build/download_nacl_irt.py

Issue 6966010: NaCl: Allow download_nacl_irt.py to be usefully invoked with no arguments (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 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: 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
« 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