Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Unified Diff: cros_workon

Issue 3389013: cros_workon: modify regen_manifest_and_sync to use loman (Closed) Base URL: http://git.chromium.org/git/crosutils.git
Patch Set: Fix nit. Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cros_workon
diff --git a/cros_workon b/cros_workon
index d48038ee148e58e2b5c87e3ddb4ca7fad74d59bf..22b375201d2fdade02095fe846ecc7f7256c377d 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"
-
- # ensure we don't clobber existing manifest entries
- if [ -f "${local_manifest}" ]; then
- grep -q -i "<remote" "${local_manifest}"
- if [ $? -ne 1 ]; then
- die "Your local manifest will be clobbered running cros_workon. You can not have any <remote> 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 "<project" "${local_manifest}" | grep -q -i "<project"
- if [ $? -eq 0 ]; then
- die "Your local manifest has mixed case tags for project. You can not have mixed case tags"
- fi
- fi
- # preserve old manifest entries
- [ -f "${local_manifest}" ] && \
- MANIFEST_ENTRIES_OLD=$(cat "${local_manifest}" | grep "^<project")
-
- rm -f "${local_manifest}"
-
- # get new manifest entries
- MANIFEST_ENTRIES=$(show_live_ebuilds |
- {
- while read line
- do
- pkgname=`basename ${line}`
- eval $(${EBUILDCMD} $(${EQUERYCMD} which ${pkgname}) info)
- REPO_ELEMENT=$(sed -n '/START_MINILAYOUT/,/STOP_MINILAYOUT/p' $REPODIR/manifest.xml | grep "name=\"${CROS_WORKON_PROJECT}\"" | sed -e 's/^[ \t]*//')
- echo "$REPO_ELEMENT"
- done
- })
-
- if [ -n "${MANIFEST_ENTRIES}" ] || [ -n "${MANIFEST_ENTRIES_OLD}" ]; then
- info "Creating local manifest for workon packages.."
- echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" >> "${local_manifest}"
- echo "<manifest>" >> "${local_manifest}"
- echo -e "${MANIFEST_ENTRIES}\n${MANIFEST_ENTRIES_OLD}" \
- | sort | uniq >> "${local_manifest}"
- echo "</manifest>" >> "${local_manifest}"
- echo "Please run \"repo sync\" now."
- fi
+ 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})/}
+
+ 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698