From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 23 20:36:55 2009 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A34A7106564A for ; Fri, 23 Jan 2009 20:36:55 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx22.fluidhosting.com [204.14.89.5]) by mx1.freebsd.org (Postfix) with ESMTP id 3979F8FC13 for ; Fri, 23 Jan 2009 20:36:55 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: (qmail 19844 invoked by uid 399); 23 Jan 2009 20:36:54 -0000 Received: from localhost (HELO ?192.168.0.19?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 23 Jan 2009 20:36:54 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <497A2A83.9010606@FreeBSD.org> Date: Fri, 23 Jan 2009 12:37:23 -0800 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: Oliver Fromme References: <200901232006.n0NK6M1B092584@lurza.secnetix.de> In-Reply-To: <200901232006.n0NK6M1B092584@lurza.secnetix.de> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Yoshihiro Ota , freebsd-hackers@FreeBSD.org, xistence@0x58.com, cperciva@FreeBSD.org Subject: Re: freebsd-update's install_verify routine excessive stating X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2009 20:36:56 -0000 Oliver Fromme wrote: > I assume, with "this" you mean my solution to the slow > shell loop problem (not quoted above), not Yoshihiro Ota's > awk proposal? I meant the solution using comm, sorry. (I forgot to mention that I would probably use cmp here, but that's a personal preference.) > Yes, it can. I already explained pretty much all of that > (useless cat etc.) in my first post in this thread. Did > you read it? Yes, I was attempting to agree with you. :) > My suggestion (after a small correction by > Christoph Mallon) was to replace the cat|cut|grep|cut > sequence with this single awk command: > > awk -F "|" '$2 ~ /^f/ {print $7}' "$@" > > For those not fluent with awk, it means this: > - Treat "|" as field separator. > - Search for lines where the second field matches ^f > (i.e. it starts with an "f"). > - Print the 7th field of those matching lines. Like I said, I haven't seen the files, but this looks good at first blush. That said, the generation of the hash list file is just a drop in the bucket. The real inefficiency in this function is the test -f for 64k files, one at a time. Doug -- This .signature sanitized for your protection