From owner-freebsd-ports@FreeBSD.ORG Sun Jun 22 18:37:21 2008 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B446106567C; Sun, 22 Jun 2008 18:37:21 +0000 (UTC) (envelope-from kris@FreeBSD.org) Received: from weak.local (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 2D2CF8FC41; Sun, 22 Jun 2008 18:37:19 +0000 (UTC) (envelope-from kris@FreeBSD.org) Message-ID: <485E9BDF.6090009@FreeBSD.org> Date: Sun, 22 Jun 2008 20:37:19 +0200 From: Kris Kennaway User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Doug Barton References: <484F12FE.6000803@FreeBSD.org> In-Reply-To: <484F12FE.6000803@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-ports@freebsd.org Subject: Re: INDEX build optimizations - please review X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2008 18:37:21 -0000 Doug Barton wrote: > Kris Kennaway wrote: > >> The new 'make describe' target runs entirely using shell builtins >> apart from the need to sed pkg-descr to extract the WWW [2] > >> [2] Actually I am not happy with this but couldn't think of a way to >> do it better. Having to fork the subshell costs about 60 seconds of >> system time and 10 of wall time. > > Here's one way to do it. This is quick and dirty and I haven't > benchmarked it, but I imagine it would be faster. > > while read one two discard; do > case "$one" in > WWW:) echo one: $one two: $two > case "$two" in > http://*) echo WWW= $two ;; > *) echo WWW= http://$two ;; > esac > break > ;; > esac > done < pkg-descr > > I did test this briefly and it pulls out the right values for > variables with and without http://. > > hth, > > Doug > Unfortunately it doesn't DTRT with files terminated with DOS-style CRLF (e.g. devel/p5-Tie-Restore, others). Kris