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

Unified Diff: lib/cros_workon_common.sh

Issue 2808072: cros-workon: extend show_workon_ebuilds to give full paths, provide wrappers (Closed) Base URL: ssh://gitrw.chromium.org/crosutils
Patch Set: 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: lib/cros_workon_common.sh
diff --git a/lib/cros_workon_common.sh b/lib/cros_workon_common.sh
index 45f3c1370311f237f3d2373abbd632e23e998211..129bc0c1d80a69f75cad5c55917c550d43660afd 100644
--- a/lib/cros_workon_common.sh
+++ b/lib/cros_workon_common.sh
@@ -6,16 +6,29 @@
# Common library for functions used by workon tools.
-show_workon_ebuilds() {
+find_workon_ebuilds() {
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
- pushd ${overlay} 1> /dev/null
- find . -name '*.ebuild' | xargs fgrep cros-workon | \
- awk -F / '{ print $2 "/" $3 }' | uniq | sort
- popd 1> /dev/null
+ # only look up ebuilds named 9999 to eliminate duplicates
+ find ${overlay}/ -name '*9999.ebuild' | xargs fgrep cros-workon | \
+ sed -e 's/\([.]ebuild\):.*/\1/'|uniq
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_sources | \
+ sed -e 's/.*\/\([^/]*\)\/\([^/]*\)\/.*\.ebuild/\1\/\2/'| sort
+}
« 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