From owner-freebsd-arch Mon Sep 2 11:46:21 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 722AA37B400; Mon, 2 Sep 2002 11:46:15 -0700 (PDT) Received: from aldan.algebra.com (aldan.algebra.com [216.254.65.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6FEEE43E4A; Mon, 2 Sep 2002 11:46:14 -0700 (PDT) (envelope-from mi@aldan.algebra.com) Received: from aldan.algebra.com (localhost [127.0.0.1]) by aldan.algebra.com (8.12.5/8.12.5) with ESMTP id g82IfXvC034754; Mon, 2 Sep 2002 14:41:33 -0400 (EDT) (envelope-from mi@aldan.algebra.com) Received: by aldan.algebra.com (8.12.5/8.12.5/Submit) id g82IfUOr034753; Mon, 2 Sep 2002 14:41:30 -0400 (EDT) Content-Type: text/plain; charset="iso-8859-1" From: Mikhail Teterin To: Jordan K Hubbard , Kris Kennaway Subject: Re: pkg-routines ignore the recorded md5 checksums Date: Mon, 2 Sep 2002 14:41:24 -0400 User-Agent: KMail/1.4.2 Cc: arch@FreeBSD.org, jkh@FreeBSD.org References: <049EDAFB-BCB3-11D6-A85D-0003938C7B7E@queasyweasel.com> In-Reply-To: <049EDAFB-BCB3-11D6-A85D-0003938C7B7E@queasyweasel.com> X-Face: %UW#n0|w>ydeGt/b@1-.UFP=K^~-:0f#O:D7whJ5G_<5143Bb3kOIs9XpX+"V+~$adGP:J|SLieM31VIhqXeLBli" Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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