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

Unified Diff: tools/get_archive.py

Issue 350483003: Build Tools Cleanup (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: more cleanup Created 6 years, 6 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
Index: tools/get_archive.py
diff --git a/tools/get_archive.py b/tools/get_archive.py
index 43cbcfd2a57d4fe8fa95708f37f379d06ac96956..a6984c1214fe99747decc3e82f285acfc76aeae3 100755
--- a/tools/get_archive.py
+++ b/tools/get_archive.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+# Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
@@ -96,7 +96,7 @@ def HasBotoConfig():
def InRunhooks():
- '''True if this script was called by "gclient runhooks" or "gclient sync"'''
+ """True if this script was called by "gclient runhooks" or "gclient sync\""""
return 'runhooks' in sys.argv
@@ -132,22 +132,21 @@ def GetDartiumRevision(name, bot, directory, version_file, latest_pattern,
"""
osdict = {'Darwin':'mac', 'Linux':'lucid64', 'Windows':'win'}
- def FindPermanentUrl(out, osname, revision_num):
+ def FindPermanentUrl(out, osname, the_revision_num):
ricow1 2014/06/23 06:58:21 the_?
output_lines = out.split()
latest = output_lines[-1]
- if not revision_num:
- revision_num = latest[latest.rindex('-') + 1 : latest.index('.')]
+ if not the_revision_num:
latest = (permanent_prefix[:permanent_prefix.rindex('/')] % { 'osname' :
osname, 'bot' : bot } + latest[latest.rindex('/'):])
else:
- latest = (permanent_prefix % { 'osname' : osname, 'num1' : revision_num,
- 'num2' : revision_num, 'bot' : bot })
+ latest = (permanent_prefix % { 'osname' : osname, 'num1' : the_revision_num,
ricow1 2014/06/23 06:58:21 long line
+ 'num2' : the_revision_num, 'bot' : bot })
foundURL = False
while not foundURL:
# Test to ensure this URL exists because the dartium-archive builds can
# have unusual numbering (a range of CL numbers) sometimes.
result, out = Gsutil('ls', permanent_prefix % {'osname' : osname,
- 'num1': revision_num, 'num2': '*', 'bot': bot })
+ 'num1': the_revision_num, 'num2': '*', 'bot': bot })
if result == 0:
# First try to find one with the the second number the same as the
# requested number.
@@ -163,12 +162,12 @@ def GetDartiumRevision(name, bot, directory, version_file, latest_pattern,
# Unable to download this item (most likely because something went
# wrong on the upload and the permissions are bad). Keep looking for
# a different URL.
- revision_num = int(revision_num) - 1
+ the_revision_num = int(the_revision_num) - 1
shutil.rmtree(temp_dir)
else:
# Now try to find one with a nearby CL num.
- revision_num = int(revision_num) - 1
- if revision_num <= 0:
+ the_revision_num = int(the_revision_num) - 1
+ if the_revision_num <= 0:
TooEarlyError()
return latest
@@ -189,7 +188,7 @@ def GetSdkRevision(name, directory, version_file, latest_pattern,
revision_num: the desired revision number, or None for the most recent
"""
osdict = {'Darwin':'macos', 'Linux':'linux', 'Windows':'win32'}
- def FindPermanentUrl(out, osname, not_used):
+ def FindPermanentUrl(osname):
ricow1 2014/06/24 07:41:55 you can't just remove those arguments, GetFromGsut
rev_num = revision_num
if not rev_num:
temp_file = tempfile.NamedTemporaryFile(delete=False)

Powered by Google App Engine
This is Rietveld 408576698