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

rpmvercmp changes

Many people have noted that rpmvercmp has a bug where, for certain
values of a and b, a > b and b > a.  This presents a problem, as there
is no definition of which is newer.

Bug 50977 (https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=50977)
was opened to deal with this issue.  After much discussion, I wrote a
patch which makes a minor change to the rpmvercmp function.  It changes
the function to always sort numeric chars higher than alpha chars.  The
patch is at

As part of the testing of the patch, I wrote a testjig to determine the
impact of the patch.  I tested upgrade and
downgrade senarios for all packages in Red Hat Linux 6.2 through 8.0.  The
testjig code, with the testcases, is available at

Testing shows that only four packages in RHL have any sort of issue with this
change -- cipe, fileutils, hanterm-xf, and textutils. 

cipe-1.4snap-1.i386.rpm shipped with RHL7.0.  More recent RHL releases
have 1.4.5-{5,6,9,11}.  Upgrades will work as expected, because numbers
are still sorted higher than letters in the modified function.

fileutils 4.0x-3 shipped in RHL7.0, and fileutils 4.0.36-4 shipped in
RHL7.1.  As above, the upgrade will work as expected.

hanterm-xf p19-15 shipped in RHL7.2 and RHL7.3, and hanterm-xf 2.0.0-6
shipped in RHL8.0.  As above, the upgrade will work as expected.

textutils 2.0e-6 shipped in RHL6.2 and textutils 2.0e-8 shipped in
RHL7.0.  In RHL7.1 textutils 2.0.11-7 was shipped.  As above, the
upgrade will work as expected.

All of these will work on upgrade, but, in the past, you could also
"upgrade" back to the version from the previous release without rpm
complaining.  With the patch, you must pass the --oldpackage flag.  I think
that this is what people will expect, as a downgrade should require the
--oldpackage flag.

Therefore, I believe that this is a safe patch to be put into rpm 4.2,
and I would like to see it get checked in soonish.  Red Hat has released
the Phoebe beta, and it would be nice if it could get into before the
next beta or release, if one is to occur.

I don't think that this will adversely affect other RPM users, but if
anyone has concerns, please speak up now.


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