NetBSD Problem Report #20905

Received: (qmail 13303 invoked by uid 605); 27 Mar 2003 10:38:50 -0000
Message-Id: <20030327103844.D771511152@narn.netbsd.org>
Date: Thu, 27 Mar 2003 02:38:44 -0800 (PST)
From: fudge_fr@users.sourceforge.net
Sender: gnats-bugs-owner@netbsd.org
Reply-To: fudge_fr@users.sourceforge.net
To: gnats-bugs@gnats.netbsd.org
Subject: textproc/grep is not honouring --program-prefix correctly
X-Send-Pr-Version: www-1.0

>Number:         20905
>Category:       pkg
>Synopsis:       textproc/grep is not honouring --program-prefix correctly
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 27 10:39:00 +0000 2003
>Closed-Date:    Thu Sep 18 19:15:12 +0000 2003
>Last-Modified:  Thu Sep 18 19:16:00 +0000 2003
>Originator:     Nicolas Fugier
>Release:        netbsd-1-6-1
>Organization:
>Environment:
SunOS sky 5.9 Generic_112233-05 sun4u sparc SUNW,Sun-Blade-1000
>Description:
textproc/grep is not honouring --program-prefix correctly.

fgrep and egrep (shell scripts created by src/Makefile) are not correctly generated: they are executing: " exec grep" which can launch non-GNU grep on Solaris platform for instance and thus cannot do the job.

GNU grep folks are aware of this pb but this is not corrected in version 2.5.1 of grep (used  by NetBSD-1-6-1).
Patch was proposed on: <http://mail.gnu.org/archive/html/bug-gnu-utils/2002-03/msg00520.html>


>How-To-Repeat:
Just try to launch fgrep or egrep on a non-native GNU platform.
>Fix:
From <http://mail.gnu.org/archive/html/bug-gnu-utils/2002-03/msg00520.html> mailing list.


--- src/Makefile.am.bak 2002-03-26 07:49:46.000000000 -0800
+++ src/Makefile.am     2002-03-27 17:59:14.964337004 -0800
@@ -20,11 +20,11 @@ EXTRA_DIST = \

 egrep:
        echo '#!/bin/sh' >$@
-       echo 'exec grep -E $${1+"$$@"}' >>$@
+       echo 'exec $(bindir)/'`echo grep|sed '$(transform)'`' -E $${1+"$$@"}' 
+>>$@
        chmod a+x $@

 fgrep:
        echo '#!/bin/sh' >$@
-       echo 'exec grep -F $${1+"$$@"}' >>$@
+       echo 'exec $(bindir)/'`echo grep|sed '$(transform)'`' -F $${1+"$$@"}' 
+>>$@
        chmod a+x $@



Same patch for Makefile.in (not generated by configure script by default AFAIK):

--- src/Makefile.in.orig_solar  Tue Mar 26 17:09:36 2002
+++ src/Makefile.in
@@ -379,12 +379,12 @@ uninstall-am: uninstall-binPROGRAMS unin

 egrep:
        echo '#!/bin/sh' >$@
-       echo 'exec grep -E $${1+"$$@"}' >>$@
+       echo 'exec $(bindir)/'`echo grep|sed '$(transform)'`' -E $${1+"$$@"}' >>$@
        chmod a+x $@

 fgrep:
        echo '#!/bin/sh' >$@
-       echo 'exec grep -F $${1+"$$@"}' >>$@
+       echo 'exec $(bindir)/'`echo grep|sed '$(transform)'`' -F $${1+"$$@"}' >>$@
        chmod a+x $@
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: wiz 
State-Changed-When: Thu Sep 18 15:14:49 EDT 2003 
State-Changed-Why:  
Applied the patch to the package -- thanks! 

From: Thomas Klausner <wiz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:  
Subject: pr/20905 CVS commit: pkgsrc/textproc/grep
Date: Thu, 18 Sep 2003 19:13:57 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	wiz
 Date:		Thu Sep 18 19:13:55 UTC 2003

 Modified Files:
 	pkgsrc/textproc/grep: Makefile distinfo
 Added Files:
 	pkgsrc/textproc/grep/patches: patch-aa

 Log Message:
 Update to 2.5.1nb2:
 Use the right grep binary in fgrep and egrep shell scripts.
 Patch provided by Nicolas Fugier in PR 20905.


 To generate a diff of this commit:
 cvs rdiff -r1.12 -r1.13 pkgsrc/textproc/grep/Makefile
 cvs rdiff -r1.4 -r1.5 pkgsrc/textproc/grep/distinfo
 cvs rdiff -r0 -r1.3 pkgsrc/textproc/grep/patches/patch-aa

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.