[Rpm-maint] [rpm-software-management/rpm] rpmvercmp() compares as equal versions that are not the same (#925)
Javier Martinez Canillas
notifications at github.com
Mon Nov 4 14:56:34 UTC 2019
There are cases when the `rpmvercmp()` function compares two different version strings as equal.
For example, in some cases adding a plus `+` character at the end of the version denotes that this version is the base version plus some changes. This is the case of the Linux kernel build system where the since the [setlocalversion](https://elixir.bootlin.com/linux/latest/source/scripts/setlocalversion#L173) scripts appends a `+` if the `CONFIG_LOCALVERSION_AUTO` option is not enabled.
Then if two options are compared using the `rpmvercmp()` function, it will wrongly do `rpmvercmp("5.3.0","5.3.0+") == 0` even when the versions are not the same.
The Fedora GRUB sorts the boot entries using the same algorithm than `rpmvercmp()`, so a locally built kernel will not appear in the boot menu due the comparing function thinking that this entry is already present, i.e: https://bugzilla.redhat.com/show_bug.cgi?id=1767395
It seems this is not the only case since in PR #597 that added support for sorting `^` higher than base version, a user [commented](https://github.com/rpm-software-management/rpm/pull/597#issuecomment-446217948) that `+` should also be supported.
An RFC pull-request fixing the specific case of `+` is #924. But this is just a special case of a more generic problem.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/925
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20191104/ae449398/attachment.html>
More information about the Rpm-maint
mailing list