cros_workon: optimize "list" slightly

Some of the repos that we search have dirs (like profiles/ and metadata/)
that will never contain ebuilds but do contain a lot of files.  Restrict
what find searches for to speed things up a bit.

BUG=None
TEST=`./cros_workon --board x86-alex list --all` shows same list of packages

Change-Id: I09f59f3bb7920a02607cc4595b99ae67c06a18cf
Reviewed-on: https://gerrit.chromium.org/gerrit/18395
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
Mike Frysinger 2012-03-16 15:07:28 -04:00 committed by David James
parent 4b7fa1e97c
commit 2af1a305e3

View File

@ -115,8 +115,8 @@ find_keyword_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 grep -l "inherit.*cros-workon" | \
find ${overlay}/*-* -maxdepth 2 -type f -name '*9999.ebuild' \
-exec grep -l 'inherit.*cros-workon' {} + 2>/dev/null | \
xargs grep -l "KEYWORDS=.*${keyword}.*"
done
}