From ino-waiting@gmx.net  Sun Dec 16 16:31:17 2001
Return-Path: <ino-waiting@gmx.net>
Received: from mailout00.sul.t-online.com (mailout00.sul.t-online.com [194.25.134.16])
	by hub.freebsd.org (Postfix) with ESMTP id AB98837B419
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 16 Dec 2001 16:31:16 -0800 (PST)
Received: from fwd03.sul.t-online.de 
	by mailout00.sul.t-online.de with smtp 
	id 16FlgZ-0003wY-00; Mon, 17 Dec 2001 01:31:15 +0100
Received: from spotteswoode.dnsalias.org (520082050842-0001@[62.155.170.185]) by fmrl03.sul.t-online.com
	with smtp id 16FlgV-1xRqEKC; Mon, 17 Dec 2001 01:31:11 +0100
Received: (qmail 8958 invoked by uid 0); 17 Dec 2001 00:31:10 -0000
Message-Id: <20011217013110.B595@spotteswoode.dnsalias.org>
Date: 17 Dec 2001 01:31:10 +0100
From: "clemensF" <ino-waiting@gmx.net>
To: FreeBSD-gnats-submit@freebsd.org
Subject: bsd.ports.mk fails for innocent $GREP_OPTIONS
X-Send-Pr-Version: 3.113

>Number:         32917
>Category:       ports
>Synopsis:       installing ports may fail if $GREP_OPTIONS is set
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    portmgr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Dec 16 16:40:01 PST 2001
>Closed-Date:    Fri Aug 30 21:28:41 PDT 2002
>Last-Modified:  Fri Aug 30 21:28:41 PDT 2002
>Originator:     Tip Chap <ino-waiting@gmx.net>
>Release:        FreeBSD 4.3-RELEASE i386
>Organization:
golden common mistakes, discorporated and irritated
>Environment:
System: FreeBSD spotteswoode.dnsalias.org 4.3-RELEASE FreeBSD 4.3-RELEASE #12: Tue Dec 11 12:23:45 CET 2001 root@spotteswoode.dnsalias.org:/usr/src/sys/compile/n1 i386


	<machine, os, target, libraries (multiple lines)>
>Description:
	after installing XFree86-4.1 right from xfree86.org (freebsd
binaries), i mounted to install Xwrapper from the ports.  all the libs were
there, all the includes, but /usr/ports/Mk/bsd.ports.mk complained the
Xlibs were missing and had to be rebuilt.  i had tried to do so up front,
but the patches didn't apply cleanly and i couldn't get
/usr/ports/x11/XFree86-4 to compile.  as i was unable to find the cause for
this, i went to download the binaries from xfree86.org, which installed
fine, except for one thing:  the installation script checks the (supplied)
extract- utilities version.  this utility is a hacked version of gnu-tar,
and its checked using this line ``fgrep "extract (XFree86 version"''.

this is when i first discovered the problems i had.  i use gnu-grep, which
(i think) is in freebsd's base install.  with "export $GREP_OPTIONS='-Ei'"
in my environment, an "unbalanced parentheses" was detected, which failed
this first trial.  i corrected the problem by unsetting the GREP_OPTIONS
and averything thereafter went ok.

without giving it much thought i switched to another shell window and went
ahead to install /usr/ports/x11/Xwrapper, but this environment had
unchanged $GREP_OPTIONS, and i couldn't find the actual cause for the
install to insist on rebuilding the entire X installation, because the
"grep -F" used to check for the name looked as unsuspicious as could be.

>How-To-Repeat:
	<code/input/activities to reproduce the problem (multiple lines)>
>Fix:

it took literally hours to find out that those GREP_OPTIONS were the cause,
and i'd like the ports-maintainer to unset this option in the make file (perhaps
putting ``GREP_OPTIONS=""'' somewhere near the top?).

clemens fischer
>Release-Note:
>Audit-Trail:

From: Steve Price <steve@havk.org>
To: clemensF <ino-waiting@gmx.net>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: ports/32917: bsd.ports.mk fails for innocent $GREP_OPTIONS
Date: Sun, 16 Dec 2001 20:26:28 -0600

 On Mon, Dec 17, 2001 at 01:31:10AM +0100, clemensF wrote:
 > 
 > it took literally hours to find out that those GREP_OPTIONS were the cause,
 > and i'd like the ports-maintainer to unset this option in the make file (perhaps
 > putting ``GREP_OPTIONS=""'' somewhere near the top?).
 
 Does adding GREP_OPTIONS='' to /etc/make.conf help?  If not, then
 it won't help by adding it to the port's Makefile either.  If it
 does, then I thinks that's the best solution.  Someone might have
 a very good reason for setting GREP_OPTIONS and for bsd.port.mk
 to blithely undo that setting isn't the right solution IMHO.
 
 -steve

From: "clemensF" <ino-waiting@gmx.net>
To: freebsd-gnats-submit@FreeBSD.org, ino-waiting@gmx.net
Cc: "Steve Price" <steve@havk.org>
Subject: Re: ports/32917: installing ports may fail if $GREP_OPTIONS is set
Date: 18 Dec 2001 21:38:19 +0100

   does, then I thinks that's the best solution.  Someone might have
   a very good reason for setting GREP_OPTIONS and for bsd.port.mk
   to blithely undo that setting isn't the right solution IMHO.
 
 me, for instance.  i had a good reason, but thinking back a lot of things
 stopped working properly, because i couldn't connect some totally unrelated
 environemnt variable with:
 
 - checksums not working,
 - unneccessary, gigantic rebuilds, eg. of the entire X library.
 
 now lemme get this straight:  if $GREP_OPTIONS is unset in the make files,
 they are *not exported up* to the enclosing environment of the caller, they
 only last for the make process.
 
 so, yes, this little thing should definitely be added to the bsd.ports.mk. 
 the entire environment should be cleaned up and standardized in this file.
 this will not disturb anything, but it will save people a lot of headaches.
 
 clemens fischer
 
 ps:  but thanks for the tip.  i actually didn't think about /etc/make.conf.
      i haven't yet checked if this is a valid fix, though.

From: Steve Price <steve@havk.org>
To: clemensF <ino-waiting@gmx.net>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: ports/32917: installing ports may fail if $GREP_OPTIONS is set
Date: Tue, 18 Dec 2001 14:52:24 -0600

 On Tue, Dec 18, 2001 at 09:38:19PM +0100, clemensF wrote:
 > 
 > now lemme get this straight:  if $GREP_OPTIONS is unset in the make files,
 > they are *not exported up* to the enclosing environment of the caller, they
 > only last for the make process.
 
 Yes.
 
 > so, yes, this little thing should definitely be added to the bsd.ports.mk. 
 > the entire environment should be cleaned up and standardized in this file.
 > this will not disturb anything, but it will save people a lot of headaches.
 
 I don't think that this will ever be put in bsd.port.mk.  The reason
 being is that bsd.port.mk can't possibly catch every case for every
 program that uses environment variables.  GREP_OPTIONS is not set by
 default and not required to use grep(1).  If you choose to use
 GREP_OPTIONS then you are responsible for what breaks because of it.
 Also as I said before someone might have a valid reason for setting
 GREP_OPTIONS to something that doesn't break a bunch of ports.  If
 it unset in bsd.port.mk then those people will complain about it
 being reset.  Your best course of action is to add it to /etc/make.conf
 and see if that works.
 
 -steve
Responsible-Changed-From-To: freebsd-ports->portmgr 
Responsible-Changed-By: ade 
Responsible-Changed-When: Mon Mar 11 19:08:06 PST 2002 
Responsible-Changed-Why:  
Lots of rambling about bsd.port.mk - punt to portmgr@ 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=32917 

From: Olivier Tharan <olivier.tharan@idealx.com>
To: freebsd-gnats-submit@FreeBSD.org, ino-waiting@gmx.net
Cc:  
Subject: Re: ports/32917: installing ports may fail if $GREP_OPTIONS is set
Date: Tue, 12 Mar 2002 10:58:40 +0100

 [ Please ignore my last email as it was a very bad copy-paste mistake ]
 
 I would like to add a piece of information on this problem, I was bitten
 by the same GREP_OPTIONS madness, which caused checksums to fail while
 building ports, and the make buildworld fail while compiling truss and
 kdump.
 
 While it may (or may not) be an option to unset GREP_OPTIONS in the BSD
 Makefiles, it could be a good idea to include the information in a FAQ
 or some other doc.
 
 olive
 -- 
 		Olivier Tharan <olivier.tharan@idealx.com>
State-Changed-From-To: open->closed 
State-Changed-By: kris 
State-Changed-When: Fri Aug 30 21:28:18 PDT 2002 
State-Changed-Why:  
Consensus seems to be that this falls into the "well, don't 
do that then" category. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=32917 
>Unformatted:
