Gentoo Archives: gentoo-dev

From: Ulrich Mueller <ulm@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Request to add ~> atom prefix operator on Portage.
Date: Mon, 14 Sep 2015 11:38:11
Message-Id: 22006.45464.52627.188518@a1i15.kph.uni-mainz.de
In Reply to: Re: [gentoo-dev] Request to add ~> atom prefix operator on Portage. by Kent Fredric
1 >>>>> On Mon, 14 Sep 2015, Kent Fredric wrote:
2
3 > On 14 September 2015 at 21:04, Ulrich Mueller <ulm@g.o> wrote:
4 >> Well, version comparison is described in [1] and it says that
5 >> =cat/foo-1.020.3 will match cat/foo-1.02.3.
6
7 > Surely, as per Algorithm 2, that is false, because "020" and "02" are
8 > both integers, and therefor they'd default to integer comparison, and
9 > "020" would be deemed ">" "02"
10
11 Comparison in Algorithm 2 only takes place for the zeroth component
12 (i.e., "1", for the example above).
13
14 For all following numeric components Algorithm 3 is called. For the
15 next component, the condition in line 1 is true, so it will remove
16 trailing zeros (i.e., both "020" and "02" will become "02") and then
17 it will use stringwise comparison.
18
19 That is, versions 1.020.3 and 1.02.3 will be considered equal.
20
21 Ulrich

Replies

Subject Author
Re: [gentoo-dev] Request to add ~> atom prefix operator on Portage. Kent Fredric <kentfredric@×××××.com>