Also rework to use find's filters instead of piping several times through grep.
Code supplied by: Douglas Freed <dwfreed>
---
 targets/stage1/stage1-controller.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/targets/stage1/stage1-controller.sh b/targets/stage1/stage1-controller.sh
index 8dbd16b..1b2eee2 100755
--- a/targets/stage1/stage1-controller.sh
+++ b/targets/stage1/stage1-controller.sh
@@ -33,9 +33,9 @@ case $1 in
 		find . -iname "*.py[co]" -exec rm -f {} \;
 		# Cleanup all .a files except libgcc.a, *_nonshared.a and
 		# /usr/lib/portage/bin/*.a
-		find . -type f -iname "*.a" | grep -v 'libgcc.a' | \
-			grep -v 'nonshared.a' | grep -v '/usr/lib/portage/bin/' | \
-			grep -v 'libgcc_eh.a' | xargs rm -f
+		find . -path usr/lib/portage -prune -o -type f \
+			-iname '*.a' ! -name 'libgcc.a' ! -name '*nonshared.a' \
+			! -name 'libgcc_eh.a' -print | xargs rm -f
 	;;
 
 	*)

Reply via email to