mirror of
https://github.com/flatcar/scripts.git
synced 2025-11-13 22:51:59 +01:00
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:
parent
a424d94ab3
commit
1f79aafb89
@ -194,6 +194,8 @@ def _UprevFromRevisionList(buildroot, tracking_branch, revision_list, board):
|
|||||||
package_str = package_str.strip()
|
package_str = package_str.strip()
|
||||||
|
|
||||||
cwd = os.path.join(buildroot, 'src', 'scripts')
|
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',
|
RunCommand(['./cros_mark_as_stable',
|
||||||
'--board=%s' % board,
|
'--board=%s' % board,
|
||||||
'--tracking_branch="%s"' % tracking_branch,
|
'--tracking_branch="%s"' % tracking_branch,
|
||||||
@ -205,6 +207,8 @@ def _UprevFromRevisionList(buildroot, tracking_branch, revision_list, board):
|
|||||||
def _UprevAllPackages(buildroot, tracking_branch, board):
|
def _UprevAllPackages(buildroot, tracking_branch, board):
|
||||||
"""Uprevs all packages that have been updated since last uprev."""
|
"""Uprevs all packages that have been updated since last uprev."""
|
||||||
cwd = os.path.join(buildroot, 'src', 'scripts')
|
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',
|
RunCommand(['./cros_mark_as_stable', '--all',
|
||||||
'--board=%s' % board,
|
'--board=%s' % board,
|
||||||
'--tracking_branch="%s"' % tracking_branch, 'commit'],
|
'--tracking_branch="%s"' % tracking_branch, 'commit'],
|
||||||
@ -230,7 +234,7 @@ def _GitCleanup(buildroot, board, tracking_branch):
|
|||||||
if os.path.exists(cwd):
|
if os.path.exists(cwd):
|
||||||
RunCommand(['./cros_mark_as_stable', '--srcroot=..',
|
RunCommand(['./cros_mark_as_stable', '--srcroot=..',
|
||||||
'--board=%s' % board,
|
'--board=%s' % board,
|
||||||
'--tracking_branch="%s"' % tracking_branch, 'clean'],
|
'--tracking_branch=%s' % tracking_branch, 'clean'],
|
||||||
cwd=cwd, error_ok=True)
|
cwd=cwd, error_ok=True)
|
||||||
|
|
||||||
|
|
||||||
@ -391,9 +395,9 @@ def _UprevPush(buildroot, tracking_branch, board, overlays):
|
|||||||
overlays = [public_overlay, private_overlay]
|
overlays = [public_overlay, private_overlay]
|
||||||
RunCommand(['./cros_mark_as_stable', '--srcroot=..',
|
RunCommand(['./cros_mark_as_stable', '--srcroot=..',
|
||||||
'--board=%s' % board,
|
'--board=%s' % board,
|
||||||
'--overlays="%s"' % " ".join(overlays),
|
'--overlays=%s' % " ".join(overlays),
|
||||||
'--tracking_branch="%s"' % tracking_branch,
|
'--tracking_branch=%s' % tracking_branch,
|
||||||
'--push_options="--bypass-hooks -f"', 'push'],
|
'--push_options=--bypass-hooks -f', 'push'],
|
||||||
cwd=cwd)
|
cwd=cwd)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -494,7 +494,9 @@ def main(argv):
|
|||||||
_BuildEBuildDictionary(overlays, gflags.FLAGS.all, package_list)
|
_BuildEBuildDictionary(overlays, gflags.FLAGS.all, package_list)
|
||||||
|
|
||||||
for overlay, ebuilds in overlays.items():
|
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)
|
os.chdir(overlay)
|
||||||
|
|
||||||
if command == 'clean':
|
if command == 'clean':
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user