[Rpm-ecosystem] Special meaning of "+" (?) separator

Florian Weimer fweimer at redhat.com
Wed Sep 14 08:28:49 UTC 2016


On 09/09/2016 10:24 PM, Igor Gnatenko wrote:
> during process of getting tilde approved in Fedora Packaging
> Guidelines we realized that we need some special handling for
> separator (most probably) "+".
>
> Some examples (left is what expected, right is what current situation):
> 1.0+ > 1.0              | 1.0+ == 1.0
> 1.0+20160101git < 1.0.1 | 1.0+20160101git > 1.0.1

I thought the approach was use any encoded that would result in the 
desired ordering?

Why not stick the "git" in the front?

 >>> sorted(['1.0', '1.0.1', '1.1', '1.0+git20160101'], cmp=lambda a, b: 
rpm.labelCompare((a,'',''), (b, '', '')))
['1.0', '1.0+git20160101', '1.0.1', '1.1']
 >>> sorted(['1.0', '1.0.1', '1.1', '1.0+20160101git'], cmp=lambda a, b: 
rpm.labelCompare((a,'',''), (b, '', '')))
['1.0', '1.0.1', '1.0+20160101git', '1.1']

> * vercmp: 1~ ? 1+
> * How "+" should be handled in (Build)Requires?
>     * BuildRequires: foo == 1+ should match 1+, 1+git, 1+whatever ?
>     * BuildRequires: foo >= 1 should match 1, 1.1, 1+git, 1.1+whatever ?
>     * BuildRequires: foo < 1+ should match 1, 1~git, 0.whatever ?

Aren't these treated as pure version comparison, so the meaning is 
pretty much fixed?

Florian


More information about the Rpm-ecosystem mailing list