Gentoo Archives: gentoo-dev

From: Daniel Campbell <zlg@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 05:38:22
Message-Id: 55F65D4E.5080302@gentoo.org
In Reply to: [gentoo-dev] Request to add ~> atom prefix operator on Portage. by konsolebox
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA256
3
4 On 09/13/2015 09:35 PM, konsolebox wrote:
5 > Many times we need to match packages like this: something-1.0.2a.*
6 >
7 > But that expression is not allowed with ~ (only targets revisions)
8 > and neither with * (.*) is invalid.
9 >
10 > So my suggestion is to add ~> as another operator. With it we can
11 > have an expression like '~>pkg-1.0.2a' and it would be equivalent
12 > to '>=pkg-1.0.2a' and '<pkg-1.0.2b'. Another expression like
13 > '~>pkg-1.0.2' would be equivalent to '>=pkg-1.0.2' and
14 > '<pkg-1.0.3'.
15 >
16 > If comparing by arithmetic operations turns out to be difficult
17 > (i.e. predicting the next version to compare against), then maybe
18 > we could just compare it with pattern(s). For example if we have
19 > 'pkg-1.02a' as the base version, then the valid versions we need to
20 > get are 'pkg-1.02a', 'pkg-1.02a.*' and
21 > 'pkg-1.02a(_(alpha|beta|pre|p)|-r)[0-9]+'.
22 >
23 > The operator is copied from Ruby's Gemfile so it would be familiar
24 > to anyone developing Ruby as well.
25 >
26 Honestly, this situation looks like a perfect candidate for slotting
27 instead of adding a new feature. If SLOT is setup correctly between
28 ebuilds, you could check to be sure it's a specific SLOT. So in your
29 case, pkg-1.0.2[a-z] would be slotted with e.g. pkg-1.0.2g:1.0.2.
30 Anything depending on it would use `pkg:1.0.2`, and the pkg-1.0.3a
31 ebuild could use SLOT="1.0.3" and be called as a dependency via
32 `pkg:1.0.3`.
33
34 Just my two cents.
35
36 - --
37 Daniel Campbell - Gentoo Developer
38 OpenPGP Key: 0x1EA055D6 @ hkp://keys.gnupg.net
39 fpr: AE03 9064 AE00 053C 270C 1DE4 6F7A 9091 1EA0 55D6
40 -----BEGIN PGP SIGNATURE-----
41 Version: GnuPG v2
42
43 iQIcBAEBCAAGBQJV9l1KAAoJEAEkDpRQOeFwM4gQANPEqNiTHQDU55eH//Iw3KVw
44 W3U2DoPR1YuxALF4vCrxDACcHxtwR0k7L7j54Hkpc6y8V93z9aJIEj396ktNSmk9
45 BYGzH+M/IO4VsEjm9Ns9GZn4fxQ2YUw3v7SVq+kqmBDNwkKU/5ZsR2XaGykQSuMQ
46 smTuZCCILdx3/6QfKQvvk6tuA6kEzLIuCpXE8l56uXJJzpKb+syWSefZftO31PU4
47 Qbj8zWlRMNoUEEQpJT7yTEzrfvRvFsMPPiHKUYw05WxjuQZzf52GZSdvBMDTTqGu
48 Ltf4BjSF/4c01zMmh3qMKmIiVzCq4pGLv0IcQ0DJmh8KAzYGP++Y+deAHLztyVGu
49 Fx793wps+/ZdfY86QQ+NFD9QHUT8RLCRvr+87YmNwQqxwQCErBF1KeQfbw0NB4m9
50 tyegRLXgiVlR9yDIo736vTyxPwHe9xtOtFMsOQRPIfKI3T8KzZlxEsAj7kfoMX16
51 eKeeJlKB2WU4wQ6tbDm3Gjjk0dZmVrU7ZAnVwG5KbXtz4oPp+rwbyX4fn8uG9rVB
52 XVJfLfJjXtkjFliFeUAKdRcm9ZyuKTO5BIppC7RCajEaHkuXSCRoBu7RpbwkyT+V
53 IMBz0Y6/dZyHMplfp5UGIqPMyUqYKQXh1MREro9xqSisxwf9RpDVj38OrbvjdvRW
54 7uilEYxSlijwOnWeCvG6
55 =EtOQ
56 -----END PGP SIGNATURE-----

Replies

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