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

Unified Diff: tools/get_drt.py

Issue 10191026: Revert r6969. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 | tools/testing/perf_testing/run_perf_tests.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/get_drt.py
===================================================================
--- tools/get_drt.py (revision 6975)
+++ tools/get_drt.py (working copy)
@@ -14,7 +14,6 @@
import subprocess
import sys
import tempfile
-import zipfile
def NormJoin(path1, path2):
return os.path.normpath(os.path.join(path1, path2))
@@ -23,22 +22,22 @@
dart_src = NormJoin(os.path.dirname(sys.argv[0]), os.pardir)
os.chdir(dart_src)
-GSUTIL_DIR = os.path.join('third_party', 'gsutil')
+GSUTIL_DIR = 'third_party/gsutil'
GSUTIL = GSUTIL_DIR + '/gsutil'
-DRT_DIR = os.path.join('client', 'tests', 'drt')
-DRT_VERSION = os.path.join(DRT_DIR, 'LAST_VERSION')
+DRT_DIR = 'client/tests/drt'
+DRT_VERSION = DRT_DIR + '/LAST_VERSION'
DRT_LATEST_PATTERN = (
'gs://dartium-archive/latest/drt-%(osname)s-inc-*.zip')
DRT_PERMANENT_PREFIX = 'gs://dartium-archive/drt-%(osname)s-inc'
-DARTIUM_DIR = os.path.join('client', 'tests', 'dartium')
-DARTIUM_VERSION = os.path.join(DARTIUM_DIR, 'LAST_VERSION')
+DARTIUM_DIR = 'client/tests/dartium'
+DARTIUM_VERSION = DARTIUM_DIR + '/LAST_VERSION'
DARTIUM_LATEST_PATTERN = (
'gs://dartium-archive/latest/dartium-%(osname)s-inc-*.zip')
DARTIUM_PERMANENT_PREFIX = 'gs://dartium-archive/dartium-%(osname)s-inc'
-sys.path.append(os.path.join(GSUTIL_DIR, 'boto'))
+sys.path.append(GSUTIL_DIR + '/boto')
import boto
@@ -58,11 +57,11 @@
def gsutil(*cmd):
- return execute_command('python', GSUTIL, *cmd)
+ return execute_command(GSUTIL, *cmd)
def gsutil_visible(*cmd):
- execute_command_visible('python', GSUTIL, *cmd)
+ execute_command_visible(GSUTIL, *cmd)
def has_boto_config():
@@ -113,8 +112,6 @@
osname = 'mac'
elif system == 'Linux':
osname = 'lucid64'
- elif system == 'Windows':
- osname = 'win'
else:
print >>sys.stderr, ('WARNING: platform "%s" does not support'
'%s for tests') % (system, name)
@@ -152,16 +149,15 @@
# download the zip file to a temporary path, and unzip to the target location
temp_dir = tempfile.mkdtemp()
try:
- temp_zip = os.path.join(temp_dir, 'drt.zip')
- temp_zip_url = 'file://' + temp_zip
+ temp_zip = temp_dir + '/drt.zip'
# It's nice to show download progress
- gsutil_visible('cp', latest, temp_zip_url)
+ gsutil_visible('cp', latest, temp_zip)
- z = zipfile.ZipFile(temp_zip)
- z.extractall(temp_dir)
- # remove .zip for dir name
- unzipped_dir = os.path.join(temp_dir, os.path.basename(latest)[:-4])
- z.close()
+ result, out = execute_command('unzip', temp_zip, '-d', temp_dir)
+ if result != 0:
+ raise Exception('Execution of "unzip %s -d %s" failed: %s' %
+ (temp_zip, temp_dir, str(out)))
+ unzipped_dir = temp_dir + '/' + os.path.basename(latest)[:-4] # remove .zip
shutil.move(unzipped_dir, directory)
finally:
shutil.rmtree(temp_dir)
« no previous file with comments | « no previous file | tools/testing/perf_testing/run_perf_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698