freebsd-update's install_verify routine excessive stating

Doug Barton dougb at FreeBSD.org
Sat Jan 24 14:33:15 PST 2009


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


More information about the freebsd-hackers mailing list