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

Unified Diff: cros_workon

Issue 2909009: cros_workon: introduce a very simple listall command (Closed) Base URL: ssh://gitrw.chromium.org/crosutils
Patch Set: Removed space at the end of the line. Thanks pre-submit check! Created 10 years, 5 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 0e5534063faf9eb441af2f69a895757b6a3e1a37..4ff535c0cbb3748b084fe8cb82bf85eb2d149820 100755
--- a/cros_workon
+++ b/cros_workon
@@ -29,11 +29,18 @@ FLAGS_HELP="usage: $0 <command> [flags]
commands:
start: Moves an ebuild to live (intended to support development)
stop: Moves an ebuild to stable (use last known good)
- list: List of all live ebuilds
+ list: List of current live ebuilds
+ listall: List all possible cros-workon ebuilds
forall: For each ebuild, cd to the source dir and run a commond"
FLAGS "$@" || exit 1
eval set -- "${FLAGS_ARGV}"
+
+# eat the workon command keywords: start, stop or list.
+WORKON_CMD=$1
+shift
+
+
# board dir config
[ -n "${FLAGS_board}" ] && [ "${FLAGS_host}" = ${FLAGS_TRUE} ] && \
die "Flags --host and --board are mutually exclusive."
@@ -48,12 +55,6 @@ else
EQUERY=equery
fi
-
-# eat the workon command keywords: start, stop or list.
-WORKON_CMD=$1
-shift
-
-
KEYWORDS_DIR=${BOARD_DIR}/etc/portage/package.keywords
UNMASK_DIR=${BOARD_DIR}/etc/portage/package.unmask
KEYWORDS_FILE=${KEYWORDS_DIR}/cros-workon
@@ -159,10 +160,25 @@ ebuild_forall() {
done
}
+show_workon_ebuilds() {
+ pushd "${BOARD_DIR}"/etc/ 1> /dev/null
+ source make.conf
+ popd 1> /dev/null
+ local CROS_OVERLAYS="${PORTDIR_OVERLAY}"
+
+ for overlay in ${CROS_OVERLAYS}; do
+ pushd ${overlay} 1> /dev/null
+ find . -name '*.ebuild' | xargs fgrep cros-workon | \
+ awk -F / '{ print $2 "/" $3 }' | uniq | sort
+ popd 1> /dev/null
+ done
+}
+
case ${WORKON_CMD} in
start) ebuild_to_live "${ATOM_LIST}" ;;
stop) ebuild_to_stable "${ATOM_LIST}" ;;
list) show_live_ebuilds ;;
forall) ebuild_forall "${ATOM_LIST}" ;;
+ listall)show_workon_ebuilds ;;
*) die "invalid cros_workon command" ;;
esac
« 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