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

Side by Side Diff: download_golang.py

Issue 759163003: Add infrastructure to download golang and build AppRTC collider. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/webrtc/webrtc.DEPS/
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « download_appengine_sdk.py ('k') | golang/linux/go.tar.gz.sha1 » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
OLDNEW
(Empty)
1 #!/usr/bin/python
2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 """Downloads the golang SDK from WebRTC storage and unpacks it.
7
8 Requires that depot_tools is installed and in the PATH. This script expects
9 to run with Chrome's base dir as the working directory, e.g. where the .gclient
10 file is. This is what should happen if this script is invoked as a hook action.
11 """
12
13 import os
14 import subprocess
15 import sys
16 import tarfile
17 import zipfile
18
19 import utils
20
21
22 def _DownloadFilesFromGoogleStorage(webrtc_deps_path):
23 print 'Downloading files in %s...' % webrtc_deps_path
24
25 extension = 'bat' if 'win32' in sys.platform else 'py'
26 cmd = ['download_from_google_storage.%s' % extension,
27 '--bucket=chromium-webrtc-resources',
28 '--auto_platform',
29 '--recursive',
30 '--directory', webrtc_deps_path]
31 subprocess.check_call(cmd)
32
33
34 def _GetGoArchivePathForPlatform():
35 archive_extension = 'zip' if utils.GetPlatform() == 'win' else 'tar.gz'
36 return os.path.join(utils.GetPlatform(), 'go.%s' % archive_extension)
37
38
39 def main(argv):
40 if len(argv) == 1:
41 return 'Usage: %s <path to webrtc.DEPS>' % argv[0]
42 if not os.path.exists('.gclient'):
43 return 'Invoked from wrong dir; invoke from dir with .gclient'
44
45 webrtc_deps_path = argv[1]
46 golang_path = os.path.join(webrtc_deps_path, 'golang')
47 archive_path = os.path.join(golang_path, _GetGoArchivePathForPlatform())
48 old_archive_sha1 = utils.ComputeSHA1(archive_path)
49
50 _DownloadFilesFromGoogleStorage(golang_path)
51
52 if old_archive_sha1 != utils.ComputeSHA1(archive_path):
53 utils.DeleteDirNextToGclient('go')
54 utils.UnpackToWorkingDir(archive_path)
55
56
57 if __name__ == '__main__':
58 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « download_appengine_sdk.py ('k') | golang/linux/go.tar.gz.sha1 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698