From owner-freebsd-hackers@FreeBSD.ORG Sat Jan 24 22:33:15 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 2177E1065672 for ; Sat, 24 Jan 2009 22:33:15 +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 8A5BB8FC14 for ; Sat, 24 Jan 2009 22:33:14 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: (qmail 19944 invoked by uid 399); 24 Jan 2009 22:33:13 -0000 Received: from localhost (HELO ?192.168.0.19?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 24 Jan 2009 22:33:13 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <497B9743.6080109@FreeBSD.org> Date: Sat, 24 Jan 2009 14:33:39 -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: <200901232222.n0NMMAcS097663@lurza.secnetix.de> In-Reply-To: <200901232222.n0NMMAcS097663@lurza.secnetix.de> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@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: Sat, 24 Jan 2009 22:33:15 -0000 Oliver Fromme wrote: > Doug Barton wrote: > > 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.) > > I see. No problem. > > However, I think cmp wouldn't work here, because cmp only > detects whether there is a difference between two files. > > In this case we need to know if one file is a subset of > the other: For every hash there must be a .gz file, but > it doesn't hurt if there are more files. So the list of > hashes can be a subset of the list of .gz files, they > don't have to be equal. Hrrmmm, that doesn't sound like a good thing to me. I would think that the hash list is pretty useless if it doesn't cover all the files. > While I were at it, I skimmed through the cmp source and > found a bug (or inefficiency): When the -s option is > specified (i.e. silent, exit code only), it would be > sufficient to terminate when the first difference is > encountered. But it always compares the whole files. > I'll try to make a patch to improve this. That would definitely be appreciated, I use cmp -s in several places in portmaster where that speed-up would make a non-trivial difference. If there is anything I can do to help please let me know. Doug -- This .signature sanitized for your protection