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

Unified Diff: cros_workon

Issue 6347052: cros_workon: collapse cros_workon_common.sh (Closed) Base URL: http://git.chromium.org/git/crosutils.git@master
Patch Set: Created 9 years, 11 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 | lib/cros_workon_common.sh » ('j') | 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 61b1e4742005afd381d3bb22b60dd61a60d4a020..0c7ded12ad3995f45c00df04a468ac49efb2e2e2 100755
--- a/cros_workon
+++ b/cros_workon
@@ -14,9 +14,6 @@
# The path to common.sh should be relative to your script's location.
. "$(dirname "$0")/common.sh"
-# Load common functions for workon scripts.
-. "$(dirname "$0")/lib/cros_workon_common.sh"
-
# Script must be run inside the chroot
restart_in_chroot_if_needed $*
get_default_board
@@ -98,6 +95,32 @@ if [ ! -L "${UNMASK_FILE}" ]; then
die "ln -s ${WORKON_FILE} ${UNMASK_FILE}"
fi
+find_keyword_workon_ebuilds() {
+ keyword="${1}"
+
+ pushd "${BOARD_DIR}"/etc/ 1> /dev/null
+ source make.conf
+ popd 1> /dev/null
+ local CROS_OVERLAYS="${PORTDIR_OVERLAY}"
+
+ # NOTE: overlay may be a symlink, and we have to use ${overlay}/
+ for overlay in ${CROS_OVERLAYS}; do
+ # only look up ebuilds named 9999 to eliminate duplicates
+ find ${overlay}/ -name '*9999.ebuild' | \
+ xargs grep -l "inherit.*cros-workon" | \
+ xargs grep -l "KEYWORDS=.*${keyword}.*"
+ done
+}
+
+show_workon_ebuilds() {
+ keyword=$1
+
+ find_keyword_workon_ebuilds ${keyword} | \
+ sed -e 's/.*\/\([^/]*\)\/\([^/]*\)\/.*\.ebuild/\1\/\2/' | \
+ sort -u
+ # This changes the absolute path to ebuilds into category/package.
+}
+
# Canonicalize package name to category/package.
canonicalize_name () {
local pkgfile
« no previous file with comments | « no previous file | lib/cros_workon_common.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698