Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Sep 2002 14:41:24 -0400
From:      Mikhail Teterin <mi+kde@aldan.algebra.com>
To:        Jordan K Hubbard <jkh@queasyweasel.com>, Kris Kennaway <kris@obsecurity.org>
Cc:        arch@FreeBSD.org, jkh@FreeBSD.org
Subject:   Re: pkg-routines ignore the recorded md5 checksums
Message-ID:  <200209021441.24904@aldan>
In-Reply-To: <049EDAFB-BCB3-11D6-A85D-0003938C7B7E@queasyweasel.com>
References:  <049EDAFB-BCB3-11D6-A85D-0003938C7B7E@queasyweasel.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Saturday 31 August 2002 03:26 am, Jordan K Hubbard wrote:
= Hysterical Raisins.  We didn't even think of adding md5 checksums until
= about a year or so after the pkg_install tools were done, and there was
= concern at that point that adding another @foo directive would create a
= set of "new packages" which didn't work with the older package tools.

That said, why is ``@comment MD5:....'' any worse than the ``@md5 ....''.
really?.. A bit longer, that's it...

Unfortunately, I managed to erase my entire Inbox recently, so I have to
respond to Jordan's comments about my patches from memory.

1. "Not every comment is an MD5 checksum". Of course it is not! The
sscanf's format string will only save those, which start with ``MD5:''. Since
the entire structure is bzero-ed a few lines above, if the comment was not
an MD5, the pkg->tail->chsum will remain empty. What is quite offensive, 
Jordan, is that I answered THIS EXACT POINT to you back on April 1st (no 
fools), in the message with the ID:

	<200204020311.g323BdFX074921@aldan.algebra.com>

You even replied to that message with <23914.1017722020@winston.freebsd.org>,
promising to review the patch, although questioning the usefulness of the 
proposed feature :-( Evidently, the doubts are gone now...

2. "Style(9) violations". I tried. Feel free to correct them if you think, I 
failed.

On the merits of Kris' (more complete) patch-set.

1. It will create packages, earlier versions will not understand -- same 
problem Jordan faced many years ago... May be, there is nothing wrong with 
``@comment ORIGIN:'', "@comment MD5:'' and others instead? Yes, the 
``@comment'' will keep growing in the future -- but that's what it is, a 
comment (a kitchen sink). The precedents are plenty -- lint directives like 
"/* fallthrough */", JavaDoc, etc.

If that "Is Wrong", perhaps, the reading part of the pkg-library should, 
indeed, be modified to skip through unrecognized lines now, and be tought 
about this new directives, but the pkg-creation part should continue using 
the ``@comment'' fields (at least, in -stable) for a good while...

2. It looked to me, like Kris' code allocates memory dynamicly for each 
checksum encountered. On my system, 94.4% of the lines in 
/var/db/pkg/*/+CONTENTS have the MD5 line behind them. I'd say, the overhead 
of malloc-ing in the 94% of the cases will eat the saving of 33 bytes wasted 
in the remaining 6%. Mmap-ing each +CONTENTS and setting pointers to various
places in it (along with the memorizing the string length) would be even 
better, but requires a lot more re-writing.

	-mi

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




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