From owner-cvs-all Thu Apr 19 14:13:50 2001 Delivered-To: cvs-all@freebsd.org Received: from sj-msg-core-2.cisco.com (sj-msg-core-2.cisco.com [171.69.43.88]) by hub.freebsd.org (Postfix) with ESMTP id AED6A37B42C; Thu, 19 Apr 2001 14:13:24 -0700 (PDT) (envelope-from bmah@cisco.com) Received: from bmah-freebsd-0.cisco.com (bmah-freebsd-0.cisco.com [171.70.84.42]) by sj-msg-core-2.cisco.com (8.9.3/8.9.1) with ESMTP id OAA15469; Thu, 19 Apr 2001 14:13:43 -0700 (PDT) Received: (from bmah@localhost) by bmah-freebsd-0.cisco.com (8.11.3/8.11.1) id f3JLDGj63092; Thu, 19 Apr 2001 14:13:16 -0700 (PDT) (envelope-from bmah) Message-Id: <200104192113.f3JLDGj63092@bmah-freebsd-0.cisco.com> X-Mailer: exmh version 2.3.1 01/19/2001 with nmh-1.0.4 To: "Akinori MUSHA" Cc: "Bruce A. Mah" , Kris Kennaway , "David O'Brien" , Chris Faulhaber , freebsd-ports@FreeBSD.org Subject: Re: cvs commit: ports/editors/vim6 Makefile distinfo pkg-plist In-Reply-To: <864rvkd47m.wl@archon.local.idaemons.org> References: <200104111956.f3BJukl93003@freefall.freebsd.org> <20010419140501.A253@jive.44bsd.net> <8666g0d8ws.wl@archon.local.idaemons.org> <20010419122255.B29435@dragon.nuxi.com> <20010419123216.A53260@xor.obsecurity.org> <200104191955.f3JJtQV60074@bmah-freebsd-0.cisco.com> <864rvkd47m.wl@archon.local.idaemons.org> Comments: In-reply-to "Akinori MUSHA" message dated "Fri, 20 Apr 2001 05:28:29 +0900." From: bmah@FreeBSD.org (Bruce A. Mah) Reply-To: bmah@FreeBSD.org X-Face: g~c`.{#4q0"(V*b#g[i~rXgm*w;:nMfz%_RZLma)UgGN&=j`5vXoU^@n5v4:OO)c["!w)nD/!!~e4Sj7LiT'6*wZ83454H""lb{CC%T37O!!'S$S&D}sem7I[A 2V%N&+ X-Image-Url: http://www.employees.org/~bmah/Images/bmah-cisco-small.gif X-Url: http://www.employees.org/~bmah/ Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==_Exmh_-120246284P"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Date: Thu, 19 Apr 2001 14:13:16 -0700 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --==_Exmh_-120246284P Content-Type: text/plain; charset=us-ascii [moving to -ports] If memory serves me right, "Akinori MUSHA" wrote: > At Thu, 19 Apr 2001 12:55:26 -0700, > Bruce A. Mah wrote: > > I suspect we might need to tweak the comparison algorithm a bit. And > > it's not entirely clear to me what it should be either, even though knu > > and I just finished reworking it. > > D'oh, I've just found pkg_version's bug!! It thinks 1.0a is smaller > than 1.0! Hmmm...yes, that's wrong, even though "1.0a" isn't technically allowed. (I wonder if the Porters Handbook might need some revision.) > I am sorry I didn't look into and check your modification over my code > carefully, but why did you modify the test?? Apparently the test I > originally wrote had been modified incorrectly and that made > pkg_version not conform to what the Handbook says. Well, geez, it's not like I *tried* to break the bloody damn thing. :-( There are some pretty strange corner cases, and, I know you're aware of this, the syntax of software package version numbers is not well defined. When you start mixing letters and digits, it's exceptionally messy. pkg_version doesn't handle the 6.0aa > 6.0z case, and it'd be pretty hard to make it do this without making a bunch of assumptions about the semantics of the characters in the version numbers. You and I differ on that point, I believe. [snip] > Unfortunately, I couldn't find an easy hotfix against the stock > CompareNumbers() routine, as it no longer takes account of various > sequences and combinations of numbers and alphabets in a version > component. See patch attached. > I'd suggest you put my code back and roll the flawless version for > 4.3-RELEASE, then hack it your way carefully again later. I'd rather we try my patch, thanks. No offense, but my meager Perl skills at least have a chance of understanding the code the way I wrote it. Bruce. ? pkg_version.diff Index: pkg_version.pl =================================================================== RCS file: /home/ncvs/src/usr.sbin/pkg_install/version/pkg_version.pl,v retrieving revision 1.17 diff -c -r1.17 pkg_version.pl *** pkg_version.pl 2001/04/03 21:26:32 1.17 --- pkg_version.pl 2001/04/19 20:53:07 *************** *** 148,154 **** else { $c1 =~ s/\d+//; $c2 =~ s/\d+//; ! return &CompareNumbers($c1, $c2); } } } --- 148,165 ---- else { $c1 =~ s/\d+//; $c2 =~ s/\d+//; ! if ($c1 eq $c2) { ! return 0; ! } ! elsif ($c1 eq "") { ! return -1; ! } ! elsif ($c2 eq "") { ! return 1; ! } ! else { ! return &CompareNumbers($c1, $c2); ! } } } } Index: test-pkg_version.sh =================================================================== RCS file: /home/ncvs/src/usr.sbin/pkg_install/version/test-pkg_version.sh,v retrieving revision 1.1 diff -c -r1.1 test-pkg_version.sh *** test-pkg_version.sh 2001/04/03 21:26:32 1.1 --- test-pkg_version.sh 2001/04/19 20:53:07 *************** *** 61,68 **** test-pv 2.3p10 ">" 2.3p9 number/letter test-pv 1.6.0 ">" 1.6.0.p3 number/letter test-pv 1.0.b ">" 1.0.a3 number/letter ! test-pv 1.0a "<" 1.0 number/letter ! test-pv 5.0a "<" 5.0.b number/letter test-pv 1.5_1 ">" 1.5 portrevision test-pv 1.5_2 ">" 1.5_1 portrevision --- 61,69 ---- test-pv 2.3p10 ">" 2.3p9 number/letter test-pv 1.6.0 ">" 1.6.0.p3 number/letter test-pv 1.0.b ">" 1.0.a3 number/letter ! test-pv 1.0a ">" 1.0 number/letter ! test-pv 1.0a "<" 1.0b number/letter ! test-pv 5.0a ">" 5.0.b number/letter test-pv 1.5_1 ">" 1.5 portrevision test-pv 1.5_2 ">" 1.5_1 portrevision --==_Exmh_-120246284P Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (FreeBSD) Comment: Exmh version 2.2 06/23/2000 iD8DBQE631Ts2MoxcVugUsMRAhH0AKC2z2TofP30CvZJb51Uj696PhMytgCeL1gx MLvgcHwIV8d/ByYhDDz5ZX0= =Lain -----END PGP SIGNATURE----- --==_Exmh_-120246284P-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message