[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: rpmvercmp() bug



In regard to: Re: rpmvercmp() bug, Enrico Scholz said (at 11:53pm on Oct...:

>There does not exist a standard versioning-scheme in package naming;

I totally agree, and it's frustrating from a package installation
standpoint, but a few simple additions (aka "hacks") to RPM's version
comparison algorithm could make it handle a lot more fringe cases as
intended by the authors of the fringe packages (who should be reprimanded
for making things harder for the rest of us).

For example, teaching RPM that

	alpha[any number] < beta[any number] < gamma[any number] < released
package version < released package + patches

It's impossible to get it right for all the cases, and get it right for
95% of the cases may be hard, but implementing logic in the version
comparison routines so that when it sees

	1.2.3p2

it assumes "patch #2 to version 1.2.3", which can be treated simply as

	1.2.3.2

Treating

	1.0 < 1.0a < 1.0b < 1.0c

is *usually* correct, but notice how the ordering often means something
different when there's a number *after* the letter:

	1.0a1 < 1.0b1 < 1.0d1 < 1.0

because when a number follows a *particular* letter (like a for alpha,
b for beta, d for delta, etc), it means a particular alpha, beta, or
delta release.

My thinking is that whenever RPM sees

	X.Y.Z-?aN

(where N is any number, and -? means 0 or 1 occurrences of -) it should
treat is as

	X.Y.Z-alphaN

(i.e. alpha release #N of a product that will eventually become version
# X.Y.Z).  likewise

	X.Y.Z-?bN

should be

	X.Y.Z-betaN

But:

	X.Y.Z-?pN

should be

	X.Y.Z-patchlevelN

and the ordering of the examples given so far is correctly

	X.Y.Z-alphaN < X.Y.Z-betaN < X.Y.Z < X.Y.Z.N


Again, this won't catch everything, but my thinking is it would work for
more cases.

Tim
-- 
Tim Mooney                              mooney@dogbert.cc.ndsu.NoDak.edu
Information Technology Services         (701) 231-1076 (Voice)
Room 242-J6, IACC Building              (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []