Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Jan 2009 14:33:39 -0800
From:      Doug Barton <dougb@FreeBSD.org>
To:        Oliver Fromme <olli@lurza.secnetix.de>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: freebsd-update's install_verify routine excessive stating
Message-ID:  <497B9743.6080109@FreeBSD.org>
In-Reply-To: <200901232222.n0NMMAcS097663@lurza.secnetix.de>
References:  <200901232222.n0NMMAcS097663@lurza.secnetix.de>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?497B9743.6080109>