Subject: Re: CVS commit: pkgsrc/mk
To: None <tech-pkg@NetBSD.org>
From: grant beattie <grant@NetBSD.org>
List: tech-pkg
Date: 02/20/2005 23:24:38
On Sun, Feb 20, 2005 at 11:33:27AM +0100, Thomas Klausner wrote:

> > fix bug introduced in 1.1569: use ${GREP} instead of 'grep' and not
> > all grep(1)s support grepping for empty string. `${GREP} .' instead.
> 
> That has different behaviour:
> # echo | grep ''
> 
> # echo $?
> 0
> # echo | grep . 
> # echo $?
> 1
> 
> Do we care?

_${def:C/=.*$//}_CMD=   ${PKG_INFO} -qp ${def:C/^.*=//} 2>/dev/null | ${AWK} '{ print $$2; exit }' | ${GREP} . || ${ECHO} ${${def:C/=.*$//}_DEFAULT}

`pkg_info -qp' is called to print the PREFIX of an installed
dependency. if this results in no output for whatever reason, grep
will fail and the default will be printed.

in fact, looking at it again now, the grep is probably redundant and
it could be just done in the awk script.

grant.