Date: Tue, 10 Jun 2008 16:49:18 -0700 From: Doug Barton <dougb@FreeBSD.org> To: freebsd-ports@freebsd.org Subject: Re: INDEX build optimizations - please review Message-ID: <484F12FE.6000803@FreeBSD.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?484F12FE.6000803>