Gentoo Archives: gentoo-user

From: Alan McKinnon <alan.mckinnon@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: How can I unmask package and mask just its one version?
Date: Sat, 30 Oct 2010 13:07:48
Message-Id: 201010301507.20075.alan.mckinnon@gmail.com
In Reply to: [gentoo-user] Re: How can I unmask package and mask just its one version? by nunojsilva@ist.utl.pt (Nuno J. Silva)
1 Apparently, though unproven, at 13:53 on Saturday 30 October 2010, Nuno J.
2 Silva did opine thusly:
3
4 > > But this is fragile and will break way too often. What if you later also
5 > > want to mask version 7? portage doesn't give you a boolean AND or any
6 > > way I know of to specify a range of versions. So you have to keep an eye
7 > > on it manually, and tweak as necessary. Or you could just list exactly
8 > > every version for which there's an ebuild and add it to the appropriate
9 > > package.* file
10 > >
11 > > This is a definite shortcoming in portage, it warrants a feature request
12 > > at b.g.o.
13 >
14 > I'm (not yet?) needing this feature, and I'm not a portage developer,
15 > but while reading this thread I found myself wondering about ways to
16 > allow this mixing of mask and unmask - I'm sharing that in case it is
17 > useful. Feel free to ignore.
18 >
19 > - obey the more specific atom, this way unmasking the whole thing in
20 > .unmask and masking specific atoms in .mask would work. (When they're
21 > equally specific, use the current behavior.)
22 >
23 > This probably involves writing something to tell which atom is the
24 > more specific, unless that already exists.
25 >
26 > An advantage is that the current atom syntax doesn't need to be
27 > changed.
28 >
29 > - add regex support: this would allow exclusion on .unmask, but the
30 > syntax may not be the best, and it must ensure it doesn't break with
31 > existing atoms (there are atoms using asterisks and package versions
32 > have lots of stops)
33
34 These are good thoughts. But, the entire topic is insanely complex, but more
35 so than first appears. If you want to know more, read the C precedence rules,
36 then read the C compiler code that implements it. Yep, that is what it takes.
37
38 The major problems as I see it in doing this for portage is that we lack a
39 precedence syntax. Putting one in is a major change to portage so not to be
40 undertaken lightly.
41
42 What I would like to see is the distinction between mask and unmask files go
43 away and be replaced with one file for masks. Prefix "+" (or none) means one
44 thing, prefix "-" means the opposite - much like USE flags are done.
45
46 Finally, there are no implicit rules that will ever fully describe what we
47 users want to do with masks. At some point there must be an explicit syntax to
48 cover these - which is what we do with nested parentheses in maths. A good
49 example of such a syntax is /etc/hosts.allow which allows nesting of ranges.
50
51
52 --
53 alan dot mckinnon at gmail dot com