From owner-freebsd-ports Tue Sep 26 16:31:57 2000 Delivered-To: freebsd-ports@freebsd.org Received: from blount.mail.mindspring.net (blount.mail.mindspring.net [207.69.200.226]) by hub.freebsd.org (Postfix) with ESMTP id 6D27B37B423; Tue, 26 Sep 2000 16:31:40 -0700 (PDT) Received: from silvia.hip.berkeley.edu (sji-ca1-01.ix.netcom.com [209.109.232.1]) by blount.mail.mindspring.net (8.9.3/8.8.5) with ESMTP id TAA18330; Tue, 26 Sep 2000 19:31:37 -0400 (EDT) Received: (from asami@localhost) by silvia.hip.berkeley.edu (8.11.0/8.11.0) id e8QNVXU40396; Tue, 26 Sep 2000 16:31:33 -0700 (PDT) (envelope-from asami) To: "Akinori -Aki- MUSHA" Cc: freebsd-ports@FreeBSD.org, bmah@FreeBSD.org Subject: Re: Enhancement of pkg_version's version comparison routine References: <86k8by6eis.wl@archon.local.idaemons.org> From: asami@FreeBSD.org (Satoshi - Ports Wraith - Asami) Date: 26 Sep 2000 16:31:28 -0700 In-Reply-To: "Akinori -Aki- MUSHA"'s message of "Wed, 27 Sep 2000 06:15:39 +0900" Message-ID: Lines: 43 X-Mailer: Gnus v5.7/Emacs 20.7 Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org * From: "Akinori -Aki- MUSHA" * Hi Bruce and Ports, * * I made a patch that fixes pkg_version's version comparison routine. * In short, it makes pkg_version recognize alpha ("a"), beta ("b"), * pre ("p"), and patchlevels as the handbook says. * * With this fix, comparisons will result as the following: * * Winer Loser Comment * 1.6.0 1.6.0.p3 Pre is before the release (*) * 1.0.b 1.0.a3 Beta is after alpha's * 1.0a 1.0 A letter "a" means alpha only when it appears * after an period. * 5.0a 5.0.b Ditto. * 3.2.ab1 3.2.p1 "ab" is unknown, but at least it should be * after alpha's, beta's and pre's. (*) * 2.3pl10 2.3pl9 Patchlevel 10 is after 9, of course (*) * * where (*) indicates previously it wasn't handled correctly. Thanks, but I think the last two cases should be handled differently. I think you should just compare the alphabetical part of "ab1" and "p1" in dictionary order. If the author says "a", "ab", then "b", then that's probably what they want. It will be easier for the porter if they knew they will be compared in alphabetical order. That should be clarified in the handbook. Also, it should also be noted that if the progression is "alpha", "beta", "gamma", "delta", and then "epsilon", then "gamma" translates to "c", not "g". (Damn Greek alphabets. :) As for the last one, "pl" is not allowed in the middle -- it can be used only when there is no major/minor numbers. The handbook is quite clear on this. Maybe pkg_version can print an error message and say that it should be changed to "2.3.10" and "2.3.9"? (Looking at the INDEX, there is no port that currently violates this rule.) Of course, if for versions such as "pl10" and "pl9", the numerals should be treated as whole numbers, not strings. Satoshi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message