Date: Tue, 15 Jun 2004 12:31:19 +0200 From: Roman Neuhauser <neuhauser@chello.cz> To: Tom Alsberg <alsbergt@cs.huji.ac.il> Cc: FreeBSD Ports List <freebsd-ports@freebsd.org> Subject: Re: /usr/ports symlink + make search Message-ID: <20040615103119.GA1704@isis.wad.cz> In-Reply-To: <20040615083216.GA24712@cs.huji.ac.il> References: <20040615083216.GA24712@cs.huji.ac.il>
next in thread | previous in thread | raw e-mail | index | archive | help
# alsbergt@cs.huji.ac.il / 2004-06-15 11:32:16 +0300: > With the new ports/Mk/bsd.port.subdir.mk, make search (seems like a > quite revamped awk script, relative to the old one) checks the second > field of INDEX to be the same as `pwd` (eventually, through awk -v > there=$here, here=`pwd`)... > My solution to it was to remove that check from the awk script: > > --- Mk/bsd.port.subdir.mk.orig Thu Jun 10 10:30:19 2004 > +++ Mk/bsd.port.subdir.mk Tue Jun 15 11:30:45 2004 > @@ -377,8 +377,6 @@ > } \ > } \ > { \ > - if ($$2 !~ there) \ > - next; \ > for (i in parms) \ > if ($$i !~ parms[i]) \ > next; \ > > I'm not sure why this check is necessary (it's all in ports, after > all), but anyway it causes some trouble and might need to be refined. Is that really a regression? It seems to work here, and the check was certainly present in the previous version (although not in the same form, see below): - @here=`pwd`; \ + @here=${.CURDIR}; \ cd ${PORTSDIR}; \ - top=`pwd -P`; \ - there=`echo "$$here/" | sed s%$$top%${PORTSDIR}%`; \ - if [ -n "$$key" ]; then \ - grep $$there ${PORTSDIR}/${INDEXFILE} | grep -i "${key}" ... - elif [ $$name ]; then \ - grep $$there ${PORTSDIR}/${INDEXFILE} | grep -i "^[^|]*$ ... + awk -F\| -v there="$$here/" -v top="$$(pwd -P)" \ + 'BEGIN { \ + sub(top, "${PORTSDIR}", there); \ What does make search print for you with this patch applied? --- Mk/bsd.port.subdir.mk 10 Jun 2004 07:30:19 -0000 1.54 +++ Mk/bsd.port.subdir.mk 15 Jun 2004 10:29:07 -0000 @@ -349,7 +349,8 @@ -v xkeylim="$${xkeylim:-${PORTSEARCH_XKEYLIM}}"\ -v display="$${display:-${PORTSEARCH_DISPLAY_FIELDS}}" \ 'BEGIN { \ - sub(top, "${PORTSDIR}", there); \ + print sub(top, "${PORTSDIR}", there); \ + print top; print there, exit; \ IGNORECASE=icase; \ keylen = length(key); keylim = keylim && keylen; \ if (!keylim && keylen) \ I get this: roman@smradoch /usr/ports 1011:0 > make search name=\^p5- 1 /usr/ports-real /usr/ports/ -- If you cc me or remove the list(s) completely I'll most likely ignore your message. see http://www.eyrie.org./~eagle/faqs/questions.html
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040615103119.GA1704>