Skip site navigation (1)Skip section navigation (2)
Date:      26 Sep 2000 16:31:28 -0700
From:      asami@FreeBSD.org (Satoshi - Ports Wraith - Asami)
To:        "Akinori -Aki- MUSHA" <knu@idaemons.org>
Cc:        freebsd-ports@FreeBSD.org, bmah@FreeBSD.org
Subject:   Re: Enhancement of pkg_version's version comparison routine
Message-ID:  <vqcog1aohm7.fsf@silvia.hip.berkeley.edu>
In-Reply-To: "Akinori -Aki- MUSHA"'s message of "Wed, 27 Sep 2000 06:15:39 %2B0900"
References:  <86k8by6eis.wl@archon.local.idaemons.org>

next in thread | previous in thread | raw e-mail | index | archive | help
 * From: "Akinori -Aki- MUSHA" <knu@idaemons.org>

 * 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




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