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

Bug 935721

Summary: app-arch/gzip-1.13: zgrep from binhost can not find grep on a split-usr system
Product: Gentoo Linux Reporter: Boris Staletic <boris.staletic>
Component: Current packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: normal CC: boris.staletic, eschwartz
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 690294    
Attachments: app-arch/gzip: embed canonical path to grep, not the one detected on $PATH

Description Boris Staletic 2024-07-07 17:50:39 UTC
Installing app-arch/gzip from a binhost on a split-usr system makes zgrep unusuable.

The relevant line of the zgrep script is

grep='${GREP-'\''/bin/grep'\''}'


Or at least that is how the line looks, on a split-usr system, if compiled manually.

If installed from a binhost, the line is

grep='${GREP-'\''/usr/bin/grep'\''}'

The line also suggests a workaround:

GREP=`which grep` zgrep FOO /proc/config.gz


Reproducible: Always

Steps to Reproduce:
1. Start with a split-usr system
2. Install gzip from a binhost
3. Attempt to zgrep a gzip archive (/proc/config.gz in my case)
Actual Results:  
/usr/bin/zgrep: 1: eval: /usr/bin/grep: not found

Expected Results:  
CONFIG_INOTIFY_USER=y

My currently chosen binhost is
https://mirror.sox.rs/gentoo/releases/amd64/binpackages/23.0/x86-64/
Comment 1 Eli Schwartz gentoo-dev 2024-07-08 16:09:06 UTC
Created attachment 897326 [details, diff]
app-arch/gzip: embed canonical path to grep, not the one detected on $PATH

This patch seems to work for me. We do this in a few other places as well...
Comment 2 Larry the Git Cow gentoo-dev 2024-07-09 03:08:49 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ef21f83344cc9a064923e058f82d781d13b1987b

commit ef21f83344cc9a064923e058f82d781d13b1987b
Author:     Eli Schwartz <eschwartz@gentoo.org>
AuthorDate: 2024-07-08 16:01:52 +0000
Commit:     Eli Schwartz <eschwartz@gentoo.org>
CommitDate: 2024-07-09 03:08:35 +0000

    app-arch/gzip: embed canonical path to grep, not the one detected on $PATH
    
    When built on a merged-usr binhost, the zgrep script embedded the
    merged-usr path to /usr/bin/grep, which did not work. It is available
    everywhere in /bin.
    
    Closes: https://bugs.gentoo.org/935721
    Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>
    Acked-by: Sam James <sam@gentoo.org>

 app-arch/gzip/{gzip-1.13.ebuild => gzip-1.13-r1.ebuild} | 4 ++++
 1 file changed, 4 insertions(+)