Gentoo Archives: gentoo-portage-dev

From: Thomas de Grenier de Latour <degrenier@×××××××××××.fr>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [Bug 44796] Per package environment variables
Date: Fri, 04 Nov 2005 20:11:10
Message-Id: 20051104210846.1040203b@eusebe
In Reply to: Re: [gentoo-portage-dev] [Bug 44796] Per package environment variables by Jason Stubbs
1 On Sat, 5 Nov 2005 02:55:01 +0900
2 Jason Stubbs <jstubbs@g.o> wrote:
3
4 > gnome-*/* for package.keywords is already not supported.
5
6 Sure, i know, but i think it's already an unfortunate limitation
7 there, and i would rather not see it again in future new config
8 files.
9
10 > There is already a (closed) bug asking for regex atom support.
11 > This is essentially what you are asking for with the BUILD_PKGS
12 > patch.
13
14 That, plus:
15 - the "!atom" negation thing (which is different from "-atom"
16 sure), because the ability to match sets of packages induces the
17 need to exclude some too, if we want to allow accurate definitions
18 of packages sets.
19 - the "system" thing, because its a subset which cant be defined
20 with patterns or anything like that, and is useful (at least in the
21 BUILD_PKGS case).
22 - the fact that it works sure, although i agree that adding a
23 special case to the package.env thing to reach that goal with that
24 approach too would be easy.
25
26 > The difference is that you are completely breaking away from the
27 > mostly standard configuration mechanisms portage currently
28 > supports.
29
30 Yes. The depatoms syntax was defined for *DEPEND variables and is
31 perfectly fine there, but imho, for some completly different
32 purposes, it is far from being optimal. Especially in conjonction to
33 this ignominous best_match_to_list() thing.
34
35 > The extension to per-package configuration beyond basic atoms is
36 > fine, but it needs to apply everywhere.
37
38 Everywhere? No, imo some stuffs are better defined with the strict
39 depatoms syntax, while others would benefit of an extended syntax.
40 It's a matter of what kind of packages sets you want to talk about:
41 - strict depatoms are for single or multiple versions of a
42 single package, and are perfect in *DEPEND strings, masks, emerge
43 command-line, etc.
44 - the extended syntax would be for sets of unrelated packages,
45 and it's more for things like package.env that it would make sense.
46
47 > > Since being able to list several env file on a same line doesn't
48 > > sounds like a must have feature to me, i would much prefer a
49 > > package.env format of that kind:
50 > > <rule> [<rule> ...] <envfile>
51 > > where <rule> would be similar to what i've defined for
52 > > BUILD_PKGS (with addition of full versioned dep atoms, which is
53 > > a trivial change to my code). And if a package happens to
54 > > match the rules lists of several lines, then the corresponding
55 > > env files would all be sourced, in the order of the said
56 > > lines. I can try to implement that if you agree on the idea.
57 >
58 > I don't see the difference in the end result. I can only see a
59 > difference in perspective. Perhaps you could enlighten me on this
60 > point?
61
62 The difference is the ability to define accurate packages sets,
63 which are the result of substractions, and thus needs severals
64 sub-rules to be defined. A very simple example of such a set, that
65 one may want to define as the packages for which a tbz2 should be
66 kept, is the following:
67 "All system packages, but the ones named something-bin
68 and the ones from the sys-kernel category".
69 With the "<rule> [<rule> ...] <envfile>" syntax, you can write it
70 as follow:
71 system !sys-kernel !*/*-bin buildpkg.env
72 (where buildpkg.env is a file with FEATURES="buildpkg" sure)
73
74 Whereas if you are tied to an "<atom> <envfile> [<envfile> ...]"
75 syntax, the best you can do is:
76 system buildpkg.env
77 sys-kernel nobuildpkg.env
78 */*-bin nobuildpkg.env
79 (where nobuildpkg.env is a file with FEATURES="-buildpkg")
80 It's getting a bit less intuitive imo. It's even worst if you
81 consider that:
82 - this "nobuildpkg.env" hack was only possible thanks to the
83 assumption that all matching lines are taken into account, in the
84 order they are in the file. If you can't even assume that, then the
85 best you can do is basically to list every single package you want
86 to match ie., write a file with hundreds of lines that you will
87 have to maintain up to date.
88 - the "nobuildpkg.env" was easy to write because this example was
89 about turning on/off a single flag. But if it was about dropping
90 all USE flags on some packages ("-*") for instance, then the
91 cancellation file (what was "nobuildpkg.env" above) would have to
92 reintroduce all the USE from make.conf, which is ugly duplication.
93
94
95 > Rather than blacklist, I'd think that whitelisting is easier.
96
97 What i thought first too, but won't work for ebuild-specifics
98 variables (like LIRC_OPTS and a few other ugliness of that kind). Or
99 they would have to be declared somewhere by ebuild writers, and
100 what is declared would be added to the whitelist. If that is doable,
101 then yes, it sounds like the best approach. Btw, iirc, the idea of
102 declaring this vars somewhere (in the ebuilds i guess) has already
103 been in the air for other reasons (env-filtering was one, and
104 showing them to users was another). Well, sounds like this
105 whitelist could be a third reason to go toward that change...
106
107 > Stuff known to portage that is okay to per-package
108 > --------------------------------------------------
109 > ACCEPT_KEYWORDS
110 > FEATURES="buildpkg ccache distcc keeptemp keepwork noauto noclean
111 > nodoc noinfo noman nostrip sandbox sfperms suidctl test userpriv
112 > usersandbox"
113 > USE
114
115 Do you mean they already work with the patch in its current state,
116 or that they could to work if some required changes are made?
117
118
119 Oh, and something i've just wondered about and i prefer to mention
120 before i forget: what about USE_EXPAND variables? Are they handled
121 fine with the current patch, or is the "variable -> USE flags"
122 conversion done only once for all in portage?
123
124 --
125 TGL.
126 --
127 gentoo-portage-dev@g.o mailing list

Replies