Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 410137

Summary: app-portage/gentoolkit-0.3.0.5: euse misuse of egrep -r searches recursively
Product: Portage Development Reporter: Vlad B. <vladb>
Component: ToolsAssignee: Portage Tools Team <tools-portage>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 346443    

Description Vlad B. 2012-03-29 12:54:31 UTC
With the following packages installed:
app-portage/gentoolkit-0.3.0.5
sys-apps/grep-2.11

In the euse file, line 1144:
if [[ -n $(echo "${line}" | egrep -re "^[^#]*${PACKAGE} ") ]]; then

egrep -re takes a long time to finish because it recursively checks all
files in cwd.

This is because the behaviour of grep changed as follows in the 2.11 release:

[http://savannah.gnu.org/forum/forum.php?forum_id=7132]:

NEWS

* Noteworthy changes in release 2.11 (2012-03-02) [stable]

** New features

If no file operand is given, and a command-line -r or equivalent
option is given, grep now searches the working directory. Formerly
grep ignored the -r and searched standard input nonrecursively.
An -r found in GREP_OPTIONS does not have this new effect.

I think the -r is not needed here. I removed it and everything seems to
work fine.
Comment 1 Paul Varner (RETIRED) gentoo-dev 2012-04-11 17:44:53 UTC
Thanks!  Fixed in the following commit: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=34f3d9824db09afe71e5254e2f75f9379b7c2b63
Comment 2 Paul Varner (RETIRED) gentoo-dev 2012-05-16 22:12:20 UTC
This was released in gentoolkit-0.3.0.6