From 2af1a305e31c88f07ba0d52c8bc5c636aabe4e35 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 16 Mar 2012 15:07:28 -0400 Subject: [PATCH] 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 Tested-by: Mike Frysinger Commit-Ready: Mike Frysinger --- cros_workon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cros_workon b/cros_workon index ca62b6c3dd..31d72c1b75 100755 --- a/cros_workon +++ b/cros_workon @@ -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 }