From e84d24ed032d1850bc1d3a04e636bd48fea765d0 Mon Sep 17 00:00:00 2001 From: Ryan Cui Date: Mon, 15 Aug 2011 19:28:13 -0700 Subject: [PATCH] cros_workon - temporarily special case chrome package When the user cros_workon starts the chrome package for a board, we set the CHROME_ORIGIN envvar to GERRIT_SOURCE, as part of the new chrome development workflow. The envvar is set in the ${board}/etc/portage/env/chromeos-base/chromeos-chrome file. We delete the file when the user runs cros_workon stop for the chrome package. This change is temporary - GERRIT_SOURCE will eventually become the default behavior. BUG=chromium-os:19112 TEST=Verified ebuild behavior for the cros_workon start and stop cases. Change-Id: I4948383bac3fc4eafc211da2058cbcb24614cedc Reviewed-on: http://gerrit.chromium.org/gerrit/6049 Reviewed-by: Ryan Cui Tested-by: Ryan Cui --- cros_workon | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/cros_workon b/cros_workon index 9374162001..65de881e4e 100755 --- a/cros_workon +++ b/cros_workon @@ -70,9 +70,11 @@ fi WORKON_DIR=${CHROOT_TRUNK_DIR}/.config/cros_workon KEYWORDS_DIR=${BOARD_DIR}/etc/portage/package.keywords UNMASK_DIR=${BOARD_DIR}/etc/portage/package.unmask +PACKAGE_ENV_DIR=${BOARD_DIR}/etc/portage/env WORKON_FILE=${WORKON_DIR}/${FLAGS_board:-host} KEYWORDS_FILE=${KEYWORDS_DIR}/cros-workon UNMASK_FILE=${UNMASK_DIR}/cros-workon +CHROME_ATOM=chromeos-base/chromeos-chrome # TODO(msb): remove the backward compatibility after 10/01/2010 if [ -d "${WORKON_DIR}" ]; then @@ -171,7 +173,10 @@ canonicalize_name () { pkgname=$(\ echo "${pkgfile}" |awk -F '/' '{ print $(NF-2) "/" $(NF-1) }') - if ! grep -q "cros-workon" ${pkgfile}; then + # TODO(rcui): remove special casing of chromeos-chrome here when we make it + # inherit from cros-workon class. Tracked in chromium-os:19259. + if [ "${pkgname}" != "${CHROME_ATOM}" ] && \ + ! grep -q "cros-workon" ${pkgfile}; then warn "${pkgname} is not a cros-workon package" 1>&2 return 1 fi @@ -235,6 +240,25 @@ regen_manifest_and_sync() { echo "Please run \"repo sync\" now." } +chrome_to_live () { + # Switch to using repo manifest checkout of chromium src. + # TODO(rcui): Remove this when CHROME_ORIGIN defaults to GERRIT_SOURCE. + # Tracked in chromium-os:19259. + env_dir=${PACKAGE_ENV_DIR}/chromeos-base + sudo mkdir -p ${env_dir} + sudo_clobber "${env_dir}/chromeos-chrome" <> \"${WORKON_FILE}\""; then atoms_success="${atoms_success} ${atom}" + if [ "${atom}" = "${CHROME_ATOM}" ]; then + chrome_to_live + fi fi else warn "Already working on ${atom}" @@ -265,6 +292,11 @@ ebuild_to_stable () { if grep -qx "=${atom}-9999" "${WORKON_FILE}" ; then if sudo sed -e "/^=${atom/\//\\/}-9999\$/d" -i "${WORKON_FILE}"; then atoms_success="${atoms_success} ${atom}" + # TODO(rcui): Remove special case when CHROME_ORIGIN defaults to + # GERRIT_SOURCE. Tracked in chromium-os:19259. + if [ "${atom}" = "${CHROME_ATOM}" ]; then + chrome_to_stable + fi fi else warn "Not working on ${atom}"