From owner-freebsd-ports@FreeBSD.ORG Tue Jun 10 23:49: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 56ABC106566B for ; Tue, 10 Jun 2008 23:49:21 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx23.fluidhosting.com [204.14.89.6]) by mx1.freebsd.org (Postfix) with ESMTP id EAFAF8FC0C for ; Tue, 10 Jun 2008 23:49:20 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: (qmail 14454 invoked by uid 399); 10 Jun 2008 23:49:19 -0000 Received: from localhost (HELO lap.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 10 Jun 2008 23:49:19 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <484F12FE.6000803@FreeBSD.org> Date: Tue, 10 Jun 2008 16:49:18 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 2.0.0.14 (X11/20080606) MIME-Version: 1.0 To: freebsd-ports@freebsd.org X-Enigmail-Version: 0.95.6 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: Tue, 10 Jun 2008 23:49:21 -0000 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 -- This .signature sanitized for your protection