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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 interpretation of the arguments. Shell behavior can differ between platforms | 55 interpretation of the arguments. Shell behavior can differ between platforms |
56 so this should be avoided when not using platform dependent shell scripts.""" | 56 so this should be avoided when not using platform dependent shell scripts.""" |
57 print 'Running: ' + ' '.join(args) | 57 print 'Running: ' + ' '.join(args) |
58 sys.stdout.flush() | 58 sys.stdout.flush() |
59 sys.stderr.flush() | 59 sys.stderr.flush() |
60 subprocess.check_call(args, cwd=cwd, env=env, shell=shell) | 60 subprocess.check_call(args, cwd=cwd, env=env, shell=shell) |
61 sys.stdout.flush() | 61 sys.stdout.flush() |
62 sys.stderr.flush() | 62 sys.stderr.flush() |
63 | 63 |
64 | 64 |
65 def CopyDir(src, dst, excludes=['.svn', '*/.svn']): | 65 def CopyDir(src, dst, excludes=('.svn', '*/.svn')): |
66 """Recursively copy a directory using.""" | 66 """Recursively copy a directory using.""" |
67 args = ['-r', src, dst] | 67 args = ['-r', src, dst] |
68 for exc in excludes: | 68 for exc in excludes: |
69 args.append('--exclude=' + exc) | 69 args.append('--exclude=' + exc) |
70 print 'cp -r %s %s' % (src, dst) | 70 print 'cp -r %s %s' % (src, dst) |
71 if os.path.abspath(src) == os.path.abspath(dst): | 71 if os.path.abspath(src) == os.path.abspath(dst): |
72 ErrorExit('ERROR: Copying directory onto itself: ' + src) | 72 ErrorExit('ERROR: Copying directory onto itself: ' + src) |
73 oshelpers.Copy(args) | 73 oshelpers.Copy(args) |
74 | 74 |
75 | 75 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 122 |
123 subprocess.check_call( | 123 subprocess.check_call( |
124 '%s cp -a public-read %s %s' % (GetGsutil(), filename, full_dst), | 124 '%s cp -a public-read %s %s' % (GetGsutil(), filename, full_dst), |
125 shell=True, | 125 shell=True, |
126 cwd=cwd) | 126 cwd=cwd) |
127 url = 'https://commondatastorage.googleapis.com/'\ | 127 url = 'https://commondatastorage.googleapis.com/'\ |
128 '%s/%s' % (bucket_path, filename) | 128 '%s/%s' % (bucket_path, filename) |
129 if step_link: | 129 if step_link: |
130 print '@@@STEP_LINK@download@%s@@@' % url | 130 print '@@@STEP_LINK@download@%s@@@' % url |
131 sys.stdout.flush() | 131 sys.stdout.flush() |
OLD | NEW |