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: Tue, 15 Sep 2015 08:38:56
Message-Id: 22007.55571.765082.245265@a1i15.kph.uni-mainz.de
In Reply to: Re: [gentoo-dev] Request to add ~> atom prefix operator on Portage. by konsolebox
1 >>>>> On Tue, 15 Sep 2015, konsolebox wrote:
2
3 > Here are my issues if we try to modify =* and not add another operator:
4
5 > 1) We'll completely abandon having an operator that matches the
6 > remaining parts of a version number for good: =cat/foo-5.2015* would
7 > no longer work.
8
9 If you look at the history, this kind of string prefix matching was
10 never intended. AFAICS, the "*" operator appeared in 2001 in Portage
11 1.6.12, and was first mentioned here:
12 https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-apps/portage/files/1.5/pym/portage.py?r1=1.43&r2=1.44
13
14 The comment there says that it should match "really minor" versions
15 and lists two examples: foo-1.0* will match 1.0.3, and glib-1.2* will
16 match glib-1.2, glib-1.2-r1, glib-1.2.1 and glib-1.2.1.1-r1, but will
17 not match glib-1.3.
18
19 > 2) We'll have to decide if we should remove the leading zeros of a
20 > version number: should 5.01.0 and and 5.1.2 be the matched the same
21 > if I used =5.01*?
22
23 Bad choice of example, as 5.01 and 5.1 are different versions (with
24 5.01 < 5.1 as one would expect). So, for a valid example you should
25 ask instead: "Should 5.010.0 and 5.01.2 be matched the same if I used
26 =5.010*?"
27
28 > We can only either allow it or not. We keep one feature, we lose the
29 > other feature. If we use another operator, =5.01* could just stay
30 > strict on matching 5.01*, whereas the operator could have the
31 > function of treating them like decimals instead. We can keep =* have
32 > the string matching feature while have another operator do the
33 > more-on-arithmetic one.
34
35 We consider 5.01 and 5.010 as equal versions. Also note that =5.010
36 will match both of them. So the only sensible behaviour is if =5.010*
37 matches all of 5.01, 5.010, 5.0100, 5.010.0, and 5.01.2.
38
39 Having an operator that allows to distinguish between equal versions
40 makes no sense.
41
42 Ulrich

Replies

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