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

Unified Diff: lib/cros_workon_common.sh

Issue 3400001: cros_workon: redefine the concept of a "workon" package list to depend on the board (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crosutils.git
Patch Set: . 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 | « cros_workon ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/cros_workon_common.sh
diff --git a/lib/cros_workon_common.sh b/lib/cros_workon_common.sh
index cd6939f04d216d7339de337bc9fc678883375fec..b7f1a12bee20ce46c8865748284b2c710aca9ed3 100644
--- a/lib/cros_workon_common.sh
+++ b/lib/cros_workon_common.sh
@@ -6,7 +6,9 @@
# Common library for functions used by workon tools.
-find_workon_ebuilds() {
+find_keyword_workon_ebuilds() {
+ keyword="${1}"
+
pushd "${BOARD_DIR}"/etc/ 1> /dev/null
source make.conf
popd 1> /dev/null
@@ -15,20 +17,17 @@ find_workon_ebuilds() {
# 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 fgrep cros-workon | \
- sed -e 's/\([.]ebuild\):.*/\1/'|uniq
+ find ${overlay}/ -name '*9999.ebuild' | \
+ xargs grep -l "inherit.*cros-workon" | \
+ xargs grep -l "KEYWORDS=.*${keyword}.*"
done
}
-# wrapper script that caches the result of find_workon_ebuilds()
-show_workon_ebuilds_files() {
- if [ -z "${CROS_ALL_EBUILDS}" ]; then
- CROS_ALL_EBUILDS=$(find_workon_ebuilds)
- fi
- echo "${CROS_ALL_EBUILDS}"
-}
-
show_workon_ebuilds() {
- show_workon_ebuilds_files | \
- sed -e 's/.*\/\([^/]*\)\/\([^/]*\)\/.*\.ebuild/\1\/\2/'| sort
+ 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.
}
« no previous file with comments | « cros_workon ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698