Fix broken quoting in cbuildbot.py, allowing for correct revving of ebuilds.

When you pass '--foo="bar baz"' to a script, the argument is literally
passed as "bar baz", with the quotes. So we need to not add unnecessary
quotes in there.

When enter_chroot.sh parses arguments, it actually removes the quotes
for you, and splits up arguments. As a result, it may actually
be necessary to (1) use the above broken syntax when you call scripts
using enter_chroot.sh; but (2) don't use that syntax when calling
scripts without enter_chroot.sh. That's a broken situation, so I've
added a TODO for that. I've also added more warnings to
cros_mark_as_stable.py so that it's easier to debug when it doesn't
work.

BUG=chromium-os:8633
TEST=Ran unit tests. Planning to watch TOT buildbot post-commit to make sure behavior is right.

Change-Id: Ia1a0e60153fec60cb7ed4db2da128ffd9ae81e23

Review URL: http://codereview.chromium.org/4385002
This commit is contained in:
David James 2010-11-03 11:15:11 -07:00
parent a424d94ab3
commit 1f79aafb89
2 changed files with 11 additions and 5 deletions

View File

@ -194,6 +194,8 @@ def _UprevFromRevisionList(buildroot, tracking_branch, revision_list, board):
package_str = package_str.strip()
cwd = os.path.join(buildroot, 'src', 'scripts')
# TODO(davidjames): --foo="bar baz" only works here because we're using
# enter_chroot.
RunCommand(['./cros_mark_as_stable',
'--board=%s' % board,
'--tracking_branch="%s"' % tracking_branch,
@ -205,6 +207,8 @@ def _UprevFromRevisionList(buildroot, tracking_branch, revision_list, board):
def _UprevAllPackages(buildroot, tracking_branch, board):
"""Uprevs all packages that have been updated since last uprev."""
cwd = os.path.join(buildroot, 'src', 'scripts')
# TODO(davidjames): --foo="bar baz" only works here because we're using
# enter_chroot.
RunCommand(['./cros_mark_as_stable', '--all',
'--board=%s' % board,
'--tracking_branch="%s"' % tracking_branch, 'commit'],
@ -230,7 +234,7 @@ def _GitCleanup(buildroot, board, tracking_branch):
if os.path.exists(cwd):
RunCommand(['./cros_mark_as_stable', '--srcroot=..',
'--board=%s' % board,
'--tracking_branch="%s"' % tracking_branch, 'clean'],
'--tracking_branch=%s' % tracking_branch, 'clean'],
cwd=cwd, error_ok=True)
@ -391,9 +395,9 @@ def _UprevPush(buildroot, tracking_branch, board, overlays):
overlays = [public_overlay, private_overlay]
RunCommand(['./cros_mark_as_stable', '--srcroot=..',
'--board=%s' % board,
'--overlays="%s"' % " ".join(overlays),
'--tracking_branch="%s"' % tracking_branch,
'--push_options="--bypass-hooks -f"', 'push'],
'--overlays=%s' % " ".join(overlays),
'--tracking_branch=%s' % tracking_branch,
'--push_options=--bypass-hooks -f', 'push'],
cwd=cwd)

View File

@ -494,7 +494,9 @@ def main(argv):
_BuildEBuildDictionary(overlays, gflags.FLAGS.all, package_list)
for overlay, ebuilds in overlays.items():
if not os.path.exists(overlay): continue
if not os.path.exists(overlay):
Warning("Skipping %s" % overlay)
continue
os.chdir(overlay)
if command == 'clean':