Add package.keywords logic to build version of chrome we specify.

Change-Id: I32c17e7353b420d7a895acffab4579c9b861095c

BUG=chromium-os:8693
TEST=Ran it with chrome_rev=tot, latest_release and stable_release

Review URL: http://codereview.chromium.org/5854001
This commit is contained in:
Chris Sosa 2010-12-14 17:57:02 -08:00
parent 48db5d2068
commit cd2196d6c5

View File

@ -27,6 +27,7 @@ ARCHIVE_BASE = '/var/www/archive'
ARCHIVE_COUNT = 10
PUBLIC_OVERLAY = '%(buildroot)s/src/third_party/chromiumos-overlay'
PRIVATE_OVERLAY = '%(buildroot)s/src/private-overlays/chromeos-overlay'
CHROME_KEYWORDS_FILE = ('/build/%(board)s/etc/portage/package.keywords/chrome')
# Currently, both the full buildbot and the preflight buildbot store their
# data in a variable named PORTAGE_BINHOST, but they're in different files.
@ -217,7 +218,7 @@ def _UprevFromRevisionList(buildroot, tracking_branch, revision_list, board,
cwd=cwd, enter_chroot=True)
def _MarkChromeAsStable(buildroot, tracking_branch, chrome_rev):
def _MarkChromeAsStable(buildroot, tracking_branch, chrome_rev, board):
"""Returns the portage atom for the revved chrome ebuild - see man emerge."""
cwd = os.path.join(buildroot, 'src', 'scripts')
portage_atom_string = RunCommand(['bin/cros_mark_chrome_as_stable',
@ -228,7 +229,12 @@ def _MarkChromeAsStable(buildroot, tracking_branch, chrome_rev):
Info('Found nothing to rev.')
return None
else:
return portage_atom_string.split('=')[1]
chrome_atom = portage_atom_string.split('=')[1]
# TODO(sosa): Workaround to build unstable chrome ebuild we uprevved.
RunCommand(['sudo', 'tee', CHROME_KEYWORDS_FILE % {'board': board}],
input='=%s\n' % chrome_atom, enter_chroot=True,
cwd=cwd)
return chrome_atom
def _UprevAllPackages(buildroot, tracking_branch, board, overlays):
@ -417,7 +423,7 @@ def _Build(buildroot, emptytree):
def _BuildChrome(buildroot, board, chrome_atom_to_build):
"""Wrapper for emerge call to build Chrome."""
cwd = os.path.join(buildroot, 'src', 'scripts')
RunCommand(['ACCEPT_KEYWORDS="* ~*"', 'emerge-%s' % board,
RunCommand(['emerge-%s' % board,
'=%s' % chrome_atom_to_build],
cwd=cwd, enter_chroot=True)
@ -735,7 +741,7 @@ def main():
# Perform uprev. If chrome_uprev is set, rev Chrome ebuilds.
if options.chrome_rev:
chrome_atom_to_build = _MarkChromeAsStable(buildroot, tracking_branch,
options.chrome_rev)
options.chrome_rev, board)
# If we found nothing to rev, we're done here.
if not chrome_atom_to_build:
return