Chromium Code Reviews| Index: buildbot/prebuilt.py |
| diff --git a/buildbot/prebuilt.py b/buildbot/prebuilt.py |
| index cf93078d845d638e50f6ca8d3445991cc719d2cf..bd0291280d92f0f4958dee512934e6169dc66208 100755 |
| --- a/buildbot/prebuilt.py |
| +++ b/buildbot/prebuilt.py |
| @@ -142,8 +142,8 @@ def RevGitPushWithRetry(retries=5): |
| """ |
| for retry in range(1, retries + 1): |
| try: |
| - cros_build_lib.RunCommand('repo sync .', shell=True) |
| - cros_build_lib.RunCommand('git push', shell=True) |
| + cros_build_lib.RunCommand(['repo', 'sync', '.']) |
| + cros_build_lib.RunCommand(['git', 'push']) |
| break |
| except cros_build_lib.RunCommandError: |
| if retry < retries: |
| @@ -168,24 +168,24 @@ def RevGitFile(filename, value, retries=5, key='PORTAGE_BINHOST'): |
| old_cwd = os.getcwd() |
| os.chdir(os.path.dirname(filename)) |
| - commit = cros_build_lib.RunCommand('git rev-parse HEAD', shell=True, |
| + commit = cros_build_lib.RunCommand(['git', 'rev-parse', 'HEAD'], |
| redirect_stdout=True).output |
| - cros_build_lib.RunCommand('git remote update', shell=True) |
| - cros_build_lib.RunCommand('repo start %s .' % prebuilt_branch, shell=True) |
| - git_ssh_config_cmd = ( |
| - 'git config url.ssh://git@gitrw.chromium.org:9222.pushinsteadof ' |
| - 'http://git.chromium.org/git') |
| - cros_build_lib.RunCommand(git_ssh_config_cmd, shell=True) |
| + cros_build_lib.RunCommand(['git', 'remote', 'update']) |
| + cros_build_lib.RunCommand(['repo', 'start', prebuilt_branch, '.']) |
| + git_ssh_config_cmd = ['git', 'config', |
|
sosa
2011/04/14 21:22:18
Style is a big wrong. If you wish to continue wit
dgarrett
2011/04/18 21:17:38
As I understand, you have a choice...
stuff ['git
Peter Mayo
2011/04/19 03:59:39
Done.
|
| + 'url.ssh://git@gitrw.chromium.org:9222.pushinsteadof', |
| + 'http://git.chromium.org/git' ] |
| + cros_build_lib.RunCommand(git_ssh_config_cmd) |
| description = 'Update %s="%s" in %s' % (key, value, filename) |
| print description |
| try: |
| UpdateLocalFile(filename, value, key) |
| - cros_build_lib.RunCommand('git config push.default tracking', shell=True) |
| - cros_build_lib.RunCommand('git commit -am "%s"' % description, shell=True) |
| + cros_build_lib.RunCommand(['git', 'config', 'push.default', 'tracking']) |
| + cros_build_lib.RunCommand(['git', 'commit', '-am', description]) |
| RevGitPushWithRetry(retries) |
| finally: |
| - cros_build_lib.RunCommand('repo abandon %s .' % prebuilt_branch, shell=True) |
| - cros_build_lib.RunCommand('git checkout %s' % commit, shell=True) |
| + cros_build_lib.RunCommand(['repo', 'abandon', 'prebuilt_branch', '.']) |
| + cros_build_lib.RunCommand(['git', 'checkout', commit]) |
| os.chdir(old_cwd) |
| @@ -240,7 +240,7 @@ def ShouldFilterPackage(file_path): |
| return False |
| -def _RetryRun(cmd, print_cmd=True, shell=False, cwd=None): |
| +def _RetryRun(cmd, print_cmd=True, cwd=None): |
| """Run the specified command, retrying if necessary. |
| Args: |
| @@ -257,13 +257,13 @@ def _RetryRun(cmd, print_cmd=True, shell=False, cwd=None): |
| # cros_build_lib. |
| for attempt in range(_RETRIES): |
| try: |
| - output = cros_build_lib.RunCommand(cmd, print_cmd=print_cmd, shell=shell, |
| + output = cros_build_lib.RunCommand(cmd, print_cmd=print_cmd, |
| cwd=cwd) |
| return True |
| except cros_build_lib.RunCommandError: |
| - print 'Failed to run %s' % cmd |
| + print 'Failed to run %r' % cmd |
| else: |
| - print 'Retry failed run %s, giving up' % cmd |
| + print 'Retry failed run %r, giving up' % cmd |
| return False |
| @@ -297,12 +297,12 @@ def _GsUpload(args): |
| acl_cmd = '%s setacl %s %s' % (_GSUTIL_BIN, acl, remote_file) |
| - if not _RetryRun(cmd, print_cmd=False, shell=True): |
| + if not _RetryRun(cmd, print_cmd=False): |
| return (local_file, remote_file) |
| if acl_cmd: |
| # Apply the passed in ACL xml file to the uploaded object. |
| - _RetryRun(acl_cmd, print_cmd=False, shell=True) |
| + _RetryRun(acl_cmd, print_cmd=False) |
| def RemoteUpload(acl, files, pool=10): |
| @@ -422,10 +422,9 @@ def UpdateBinhostConfFile(path, key, value): |
| config_file = file(path, 'w') |
| config_file.close() |
| UpdateLocalFile(path, value, key) |
| - cros_build_lib.RunCommand('git add %s' % filename, cwd=cwd, shell=True) |
| + cros_build_lib.RunCommand(['git', 'add', filename], cwd=cwd) |
| description = 'Update %s=%s in %s' % (key, value, filename) |
| - cros_build_lib.RunCommand('git commit -m "%s"' % description, cwd=cwd, |
| - shell=True) |
| + cros_build_lib.RunCommand(['git', 'commit', '-m', description], cwd=cwd) |
| def _GrabAllRemotePackageIndexes(binhost_urls): |
| @@ -512,7 +511,7 @@ class PrebuiltUploader(object): |
| if pkgs: |
| cmds.append('rsync -Rav %(pkgs)s %(remote_location)s/' % d) |
| for cmd in cmds: |
| - if not _RetryRun(cmd, shell=True, cwd=package_path): |
| + if not _RetryRun(cmd, cwd=package_path): |
| raise UploadFailed('Could not run %s' % cmd) |
| def _SyncHostPrebuilts(self, build_path, version, key, git_sync, |