Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 838856 - Wrong version ordering for _rc (e.g. heat-18.0.0.0_rc1 and heat-18.0.0)
Summary: Wrong version ordering for _rc (e.g. heat-18.0.0.0_rc1 and heat-18.0.0)
Status: RESOLVED INVALID
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-16 19:37 UTC by Alessandro Barbieri
Modified: 2022-04-18 09:37 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alessandro Barbieri 2022-04-16 19:37:15 UTC
if you name two packages heat-18.0.0.0_rc1 and heat-18.0.0 portage will consider heat-18.0.0.0_rc1 the newest while from upstream, heat-18.0.0 is the newest
is this intended?
isn't x_rc1 < x and y.0 = y.0.0 ?
Comment 1 Mike Gilbert gentoo-dev 2022-04-16 19:44:36 UTC
The version comparision algorithm is specified in PMS. I believe Portage implements it as specified.

https://projects.gentoo.org/pms/8/pms.html#x1-260003.3
Comment 2 Alessandro Barbieri 2022-04-16 19:50:35 UTC
What is invalid? Upstream versioning scheme? Or you that don't believe me?
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-04-16 19:55:24 UTC
(In reply to Alessandro Barbieri from comment #2)
> What is invalid? Upstream versioning scheme? Or you that don't believe me?

floppym is saying the current implementation adheres to PMS.

Do you think it doesn't agree with PMS, or it does but you want PMS changed?
Comment 4 Alessandro Barbieri 2022-04-16 20:08:56 UTC
I think it's reasonable to expect that 18.0.0 > 18.0.0.0_rc1
so I want to get this discussed and eventually change the PMS
Comment 5 Mike Gilbert gentoo-dev 2022-04-16 20:14:24 UTC
Version comparisons are performed left to right, component by component. This is the behavior specified in PMS.

In other words:

18.0.0_rc1 < 18.0.0 <  18.0.0.0_rc1 < 18.0.0.0

Changing this order would require updating PMS.
Comment 6 Mike Gilbert gentoo-dev 2022-04-16 20:15:31 UTC
(In reply to Alessandro Barbieri from comment #4)
> I think it's reasonable to expect that 18.0.0 > 18.0.0.0_rc1
> so I want to get this discussed and eventually change the PMS

Please propose a new algorithm, and discuss it on the gentoo-dev mailing list.
Comment 7 Ulrich Müller gentoo-dev 2022-04-16 21:38:45 UTC
We have 1.0.0 > 1.0 which was an intentional design choice, I suppose. It agrees with the ordering of strverscmp(3).
Comment 8 Larry the Git Cow gentoo-dev 2022-04-18 09:37:19 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=7de2f154c775e9de276f2fc1f619922f48a13b90

commit 7de2f154c775e9de276f2fc1f619922f48a13b90
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2022-04-18 09:35:48 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2022-04-18 09:35:48 +0000

    libq/atom: implement strict PMS 3.3 in atom_compare
    
    Version comparisons are complex, stick with strict PMS definition for
    it, so we produce the same results as Portage.
    
    Bug: https://bugs.gentoo.org/838856
    Signed-off-by: Fabian Groffen <grobian@gentoo.org>

 autogen.sh                        |   1 +
 libq/atom.c                       | 249 ++++++++++++++++++++++++++++++++------
 tests/atom_compare/static.q.good  |   3 +-
 tests/atom_compare/static.q.tests |   1 +
 4 files changed, 219 insertions(+), 35 deletions(-)