Gentoo Archives: gentoo-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: Feature request: package.use.stable.mask and package.use.stable.force
Date: Sat, 28 Apr 2012 21:30:26
Message-Id: 4F9C6146.9010306@gentoo.org
In Reply to: Re: [gentoo-dev] Re: Feature request: package.use.stable.mask and package.use.stable.force by Mike Frysinger
1 On 04/28/2012 02:17 PM, Mike Frysinger wrote:
2 > On Friday 27 April 2012 03:30:43 Zac Medico wrote:
3 >> On 04/26/2012 11:48 PM, Zac Medico wrote:
4 >>> On 04/26/2012 11:28 PM, Mike Frysinger wrote:
5 >>>> On Friday 27 April 2012 00:43:15 Jonathan Callen wrote:
6 >>>>> On 04/26/2012 06:03 PM, Andreas K. Huettel wrote:
7 >>>>>> I'd like to suggest we introduce the following very useful
8 >>>>>> feature, as soon as possible (which likely means in the next
9 >>>>>> EAPI?):
10 >>>>>>
11 >>>>>> * two new files in profile directories supported,
12 >>>>>> package.use.stable.mask and package.use.stable.force * syntax is
13 >>>>>> identical to package.use.mask and package.use.force * meaning is
14 >>>>>> identical to package.use.mask and package.use.force, except that
15 >>>>>> the resulting rules are ONLY applied iff a stable keyword is in
16 >>>>>> use
17 >>>>>
18 >>>>> As "a stable keyword is in use" is either ambiguous or outright wrong
19 >>>>> (depending on exactly what was meant by that), I would propose that
20 >>>>> one of the following cases replace that:
21 >>>>>
22 >>>>> * At least one keyword beginning with "~" or the value "**" is in the
23 >>>>> global ACCEPT_KEYWORDS.
24 >>>>> * At least one keyword beginning with "~" or the value "**" is in the
25 >>>>> ACCEPT_KEYWORDS used for the package in question.
26 >>>>>
27 >>>>> This is required because on a typical ~amd64 system, the effective
28 >>>>> value of ACCEPT_KEYWORDS is "amd64 ~amd64" -- which would be covered
29 >>>>> under "a stable keyword is in use" (the same applies for other arches
30 >>>>> as well).
31 >>>>
32 >>>> i don't think that wording is correct and misses the point. simple
33 >>>> example of how this should work:
34 >>>>
35 >>>> if package.use.stable.force has:
36 >>>> cat/pkg foo
37 >>>>
38 >>>> and then cat/pkg/pkg-0.ebuild has:
39 >>>> KEYWORDS="~amd64 x86"
40 >>>>
41 >>>> the forcing of "foo" would apply to people who are ARCH=x86 (regardless
42 >>>> of their ACCEPT_KEYWORDS containing ~x86), but not apply to people who
43 >>>> are ARCH=amd64. once the ebuild changes to KEYWORDS="amd64 x86", then
44 >>>> it would apply to both.
45 >>>>
46 >>>> i.e. the keyword matching is to the ebuild, not to the user's
47 >>>> ACCEPT_KEYWORDS.
48 >>>
49 >>> That makes sense in the context of trying to keep repoman from
50 >>> complaining. Since repoman complains about stable keywords for packages
51 >>> with unstable dependencies, package.use.stable.{force,mask} will serve
52 >>> to mask off conditional dependencies that would otherwise trigger
53 >>> *DEPEND.bad complaints from repoman.
54 >>
55 >> Actually, I don't think the specification should involve ARCH. In order
56 >> to determine whether package.use.stable.{force,mask} apply, I would
57 >> intersect KEYWORDS with ACCEPT_KEYWORDS, and apply
58 >> package.use.stable.{force,mask} if this intersection contains only
59 >> stable keywords. So, I think that I mostly agree with Jonathan's
60 >> statements, though I describe the behavior slightly differently than how
61 >> he did.
62 >
63 > wrt repoman, it doesn't know anything about ACCEPT_KEYWORDS
64
65 It does know about ACCEPT_KEYWORDS because it generates them
66 automatically from KEYWORDS. The relevant code in /usr/bin/repoman looks
67 like this:
68
69 arches=[]
70 for keyword in myaux["KEYWORDS"].split():
71 if (keyword[0]=="-"):
72 continue
73 elif (keyword[0]=="~"):
74 arches.append([keyword, keyword[1:], [keyword[1:], keyword]])
75 else:
76 arches.append([keyword, keyword, [keyword]])
77 if not arches:
78 # Use an empty profile for checking dependencies of
79 # packages that have empty KEYWORDS.
80 arches.append(['**', '**', ['**']])
81
82 > as for intersection, i don't think that works. if my make.conf is:
83 > ACCEPT_KEYWORDS="amd64 ~amd64"
84 > and i emerge a package that has:
85 > KEYWORDS="~amd64"
86 >
87 > package.use.stable should not apply to this package. it should only apply if
88 > it had:
89 > KEYWORDS="amd64"
90
91 See the algorithm that I've described here:
92
93 http://archives.gentoo.org/gentoo-dev/msg_6c492ae43ad7c70cef6aa8ac34911adf.xml
94
95 The case that you're talking about is equivalent to the 4th row of the
96 table in that message, and note that it says "no" in the package.stable
97 column, as you would expect.
98 --
99 Thanks,
100 Zac