| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Common utilities for all buildbot scripts that specifically don't rely | 5 """Common utilities for all buildbot scripts that specifically don't rely |
| 6 on having a full chromium checkout. | 6 on having a full chromium checkout. |
| 7 """ | 7 """ |
| 8 | 8 |
| 9 import os | 9 import os |
| 10 import subprocess | 10 import subprocess |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 def __getitem__(self, key): | 73 def __getitem__(self, key): |
| 74 return self.env[key] | 74 return self.env[key] |
| 75 | 75 |
| 76 def SetEnv(self, key, value): | 76 def SetEnv(self, key, value): |
| 77 self.env[key] = value | 77 self.env[key] = value |
| 78 | 78 |
| 79 def __setitem__(self, key, value): | 79 def __setitem__(self, key, value): |
| 80 self.env[key] = value | 80 self.env[key] = value |
| 81 | 81 |
| 82 context = FakeContext() | 82 context = FakeContext() |
| 83 context['gyp_vars'] = [] |
| 83 buildbot_standard.SetupWindowsEnvironment(context) | 84 buildbot_standard.SetupWindowsEnvironment(context) |
| 84 | 85 |
| 85 # buildbot_standard.SetupWindowsEnvironment adds the directory which contains | 86 # buildbot_standard.SetupWindowsEnvironment adds the directory which contains |
| 86 # vcvarsall.bat to the path, but not the directory which contains cl.exe, | 87 # vcvarsall.bat to the path, but not the directory which contains cl.exe, |
| 87 # link.exe, etc. | 88 # link.exe, etc. |
| 88 # Running vcvarsall.bat adds the correct directories to the path, which we | 89 # Running vcvarsall.bat adds the correct directories to the path, which we |
| 89 # extract below. | 90 # extract below. |
| 90 process = subprocess.Popen('vcvarsall.bat x86 > NUL && set', | 91 process = subprocess.Popen('vcvarsall.bat x86 > NUL && set', |
| 91 stdout=subprocess.PIPE, env=context.env, shell=True) | 92 stdout=subprocess.PIPE, env=context.env, shell=True) |
| 92 stdout, _ = process.communicate() | 93 stdout, _ = process.communicate() |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 # Without shell=True the windows implementation of subprocess.call will not | 201 # Without shell=True the windows implementation of subprocess.call will not |
| 201 # search the PATH for the executable: http://bugs.python.org/issue8557 | 202 # search the PATH for the executable: http://bugs.python.org/issue8557 |
| 202 shell = getos.GetPlatform() == 'win' | 203 shell = getos.GetPlatform() == 'win' |
| 203 | 204 |
| 204 cmd = [GetGsutil(), 'cp', '-a', 'public-read', filename, full_dst] | 205 cmd = [GetGsutil(), 'cp', '-a', 'public-read', filename, full_dst] |
| 205 Run(cmd, shell=shell, cwd=cwd) | 206 Run(cmd, shell=shell, cwd=cwd) |
| 206 url = 'https://storage.googleapis.com/%s/%s' % (bucket_path, filename) | 207 url = 'https://storage.googleapis.com/%s/%s' % (bucket_path, filename) |
| 207 if step_link: | 208 if step_link: |
| 208 sys.stdout.flush() | 209 sys.stdout.flush() |
| 209 sys.stderr.write('@@@STEP_LINK@download@%s@@@\n' % url) | 210 sys.stderr.write('@@@STEP_LINK@download@%s@@@\n' % url) |
| OLD | NEW |