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

Unified Diff: cros_workon

Issue 3352002: cros_workon: print out short summary of what has been done for start/stop (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crosutils.git
Patch Set: Addressed a 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 e9400da47dc31b26289c40f44d3a58100aaeada3..57835f8d51a0d56089a1f3851242c5620aca36b9 100755
--- a/cros_workon
+++ b/cros_workon
@@ -59,10 +59,12 @@ if [ -n "${FLAGS_board}" ]; then
BOARD_DIR=/build/"${FLAGS_board}" # --board specified
EQUERYCMD=equery-"${FLAGS_board}"
EBUILDCMD=ebuild-"${FLAGS_board}"
+ BOARD_STR="${FLAGS_board}"
else
BOARD_DIR="" # --host specified
EQUERYCMD=equery
EBUILDCMD=ebuild
+ BOARD_STR="host"
fi
WORKON_DIR=${CHROOT_TRUNK_DIR}/.config/cros_workon
@@ -200,29 +202,37 @@ regen_manifest_and_sync() {
# src_unpack step fetches the package source for local development.
ebuild_to_live () {
local atoms=$1
+ local atoms_success=""
for atom in ${atoms}; do
if ! grep -qx "[~=]${atom}-9999" "${WORKON_FILE}" ; then
- sudo bash -c "echo \"=${atom}-9999\" >> \"${WORKON_FILE}\""
+ if sudo bash -c "echo \"=${atom}-9999\" >> \"${WORKON_FILE}\""; then
+ atoms_success="${atoms_success} ${atom}"
+ fi
else
warn "Already working on ${atom}"
fi
done
+ [ -n "${atoms_success}" ] && regen_manifest_and_sync && \
+ info "Started working on '${atoms_success/ /}' for '${BOARD_STR}'"
}
# Move a live development ebuild back to stable.
ebuild_to_stable () {
local atoms=$1
+ local atoms_success=""
for atom in ${atoms}; do
if grep -qx "[~=]${atom}-9999" "${WORKON_FILE}" ; then
- sudo bash -c "grep -v '^[~=]${atom}-9999\$' \"${WORKON_FILE}\" > \
- \"${WORKON_FILE}+\""
- sudo mv "${WORKON_FILE}+" "${WORKON_FILE}"
+ if sudo sed -e "/^[~=]${atom/\//\\/}-9999\$/d" -i "${WORKON_FILE}"; then
+ atoms_success="${atoms_success} ${atom}"
+ fi
else
warn "Not working on ${atom}"
fi
done
+ [ -n "${atoms_success}" ] && \
+ info "Stopped working on '${atoms_success/ /}' for '${BOARD_STR}'"
}
# Run a command on all or a set of repos.
@@ -258,7 +268,7 @@ else # not selected --all
fi
case ${WORKON_CMD} in
- start) ebuild_to_live "${ATOM_LIST}"; regen_manifest_and_sync ;;
+ start) ebuild_to_live "${ATOM_LIST}" ;;
stop) ebuild_to_stable "${ATOM_LIST}" ;;
list) [ ${FLAGS_all} = "${FLAGS_FALSE}" ] && show_live_ebuilds || show_workon_ebuilds ;;
iterate)ebuild_iterate "${ATOM_LIST}" ;;
« 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