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

Unified Diff: tools/upload_sdk.py

Issue 9053006: Fixing upload_sdk for windows. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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 | « tools/testing/perf_testing/create_graph.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/upload_sdk.py
===================================================================
--- tools/upload_sdk.py (revision 2872)
+++ tools/upload_sdk.py (working copy)
@@ -10,12 +10,17 @@
import os
import os.path
+import platform
import subprocess
import sys
import utils
GSUTIL = '/b/build/scripts/slave/gsutil'
+HAS_SHELL = False
+if platform.system() == 'Windows':
+ GSUTIL = 'e:\\\\b\\build\\scripts\\slave\\gsutil'
+ HAS_SHELL = True
GS_SITE = 'gs://'
GS_DIR = 'dart-dump-render-tree'
GS_SDK_DIR = 'sdk'
@@ -25,7 +30,8 @@
"""Execute a command in a subprocess.
"""
print 'Executing: ' + ' '.join(cmd)
- pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
+ shell=HAS_SHELL)
output = pipe.communicate()
if pipe.returncode != 0:
print 'Execution failed: ' + str(output)
@@ -48,7 +54,7 @@
def GetSVNRevision():
p = subprocess.Popen(['svn', 'info'], stdout = subprocess.PIPE,
- stderr = subprocess.STDOUT, close_fds=True)
+ stderr = subprocess.STDOUT, shell=HAS_SHELL)
output, not_used = p.communicate()
for line in output.split('\n'):
if 'Revision' in line:
@@ -93,12 +99,18 @@
sdk_file = 'dart-%s-%s%s.zip' % (utils.GuessOS(), revision, sdk_suffix)
if (os.path.exists(SDK_LOCAL_ZIP)):
os.remove(SDK_LOCAL_ZIP)
- ExecuteCommand(['zip', '-yr', SDK_LOCAL_ZIP, os.path.basename(argv[1])])
+ if platform.system() == 'Windows':
+ # Windows does not have zip. We use the 7 zip utility we pull down from
+ # third party.
+ ExecuteCommand([os.path.join('..', 'third_party', '7za920', '7za'), 'a',
+ '-tzip', SDK_LOCAL_ZIP, os.path.basename(argv[1])])
+ else:
+ ExecuteCommand(['zip', '-yr', SDK_LOCAL_ZIP, os.path.basename(argv[1])])
UploadArchive(SDK_LOCAL_ZIP,
- GS_SITE + os.path.join(gsdir, GS_SDK_DIR, sdk_file))
+ GS_SITE + '/'.join([gsdir, GS_SDK_DIR, sdk_file]))
latest_name = 'dart-%s-latest%s.zip' % (utils.GuessOS(), sdk_suffix)
UploadArchive(SDK_LOCAL_ZIP,
- GS_SITE + os.path.join(gsdir, GS_SDK_DIR, latest_name))
+ GS_SITE + '/'.join([gsdir, GS_SDK_DIR, latest_name]))
if __name__ == '__main__':
« no previous file with comments | « tools/testing/perf_testing/create_graph.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698