From f0eb4604d7df554278db1974018a7806609c6212 Mon Sep 17 00:00:00 2001 From: Mandeep Singh Baines Date: Thu, 16 Sep 2010 10:57:54 -0700 Subject: [PATCH] cros_workon: modify regen_manifest_and_sync to use loman This fixes a bug where user added local_manifest.xml entries get clobbered. BUG=5787 TEST=Verified start of various packages works correctly. Change-Id: I2348dfb1be098b81ede5928426192c655160564d Review URL: http://codereview.chromium.org/3389013 --- cros_workon | 56 ++++++++--------------------------------------------- 1 file changed, 8 insertions(+), 48 deletions(-) diff --git a/cros_workon b/cros_workon index d48038ee14..22b375201d 100755 --- a/cros_workon +++ b/cros_workon @@ -153,55 +153,15 @@ find_repo_dir () { # This is called only for "cros-workon start". We dont handle the "stop" case since the local changes are ignored anyway since the 9999.ebuild is masked and we dont want to deal with what to do with the user's local changes. regen_manifest_and_sync() { - find_repo_dir - local_manifest="${REPODIR}/local_manifest.xml" + for pkgname in $(show_live_ebuilds); do + eval $(${EBUILDCMD} $(${EQUERYCMD} which ${pkgname}) info) + local srcdir=$(readlink -f ${CROS_WORKON_SRCDIR}) + local trunkdir=$(readlink -f ${CHROOT_TRUNK_DIR}) + local project_path=${srcdir#$(readlink -f ${CHROOT_TRUNK_DIR})/} - # ensure we don't clobber existing manifest entries - if [ -f "${local_manifest}" ]; then - grep -q -i " tags at all." - fi - sed -ne '/^[[:space:]]\+[^[:space:]]/q1' "${local_manifest}" - if [ $? -ne 0 ]; then - die "Your local manifest will be clobbered running cros_workon. You can not have any tags that span multiple lines or are indented." - fi - egrep -q "^[^<]" "${local_manifest}" - if [ $? -ne 1 ]; then - die "Your local manifest will be clobbered running cros_workon. You can not have any tags that span multiple lines" - fi - grep -v "" >> "${local_manifest}" - echo "" >> "${local_manifest}" - echo -e "${MANIFEST_ENTRIES}\n${MANIFEST_ENTRIES_OLD}" \ - | sort | uniq >> "${local_manifest}" - echo "" >> "${local_manifest}" - echo "Please run \"repo sync\" now." - fi + loman add --workon "${CROS_WORKON_PROJECT}" "${project_path}" + done + echo "Please run \"repo sync\" now." } # Move a stable ebuild to the live development catgeory. The ebuild