1 |
glen martin schreef: |
2 |
> Holly Bostick wrote: |
3 |
> |
4 |
>> glen martin schreef: |
5 |
>> |
6 |
>>> As an aside, I wonder whether it is a good feature idea that |
7 |
>>> ACCEPT_KEYWORDS="<keyword>" emerge <foo> without --oneshot should |
8 |
>>> automatically add <foo> <keyword> to the package.keywords file. |
9 |
>> |
10 |
>> That's an idea with some merit, but imo not enough (merit) to make |
11 |
>> it feasible (but it's not my decision; submit a feature request and |
12 |
>> see what happens). |
13 |
>> |
14 |
>> You now know firsthand one of the many reasons that using |
15 |
>> ACCEPT_KEYWORDS on the command line is *not* recommended. |
16 |
>> |
17 |
>> It is a temporary setting, useful only for testing situations. |
18 |
> |
19 |
> That makes sense. I hadn't encountered that recommendation at the |
20 |
> time - I'd seen the ACCEPT_KEYWORDS syntax without such warning. Not |
21 |
> in the man page, obviously, which has it right. |
22 |
> |
23 |
>> The idea of having the temporary setting invisibly add a permanent |
24 |
>> setting seems cool, |
25 |
> |
26 |
> The trick here is the word 'temporary'. If 'temporary', the keyword |
27 |
> --oneshot would (should?) be present. In absence thereof ... It seems |
28 |
> analogous to the world file - the world file is the permanent |
29 |
> specification, and it written per presence or absence of oneshot. Why |
30 |
> not so for /etc/portage/package.*? How are those files |
31 |
> different-in-kind from world? |
32 |
|
33 |
|
34 |
OK, I'm not an expert either, but I *think* that the issue is the fact |
35 |
that ACCEPT_KEYWORDS and emerge are *two separate commands*. |
36 |
|
37 |
Are you familiar with exporting variables? ACCEPT_KEYWORDS is, of course |
38 |
a variable. When you export a variable (DISPLAY, LD_ASSUME_KERNEL, |
39 |
LD_LIBRARY_PATH, LD_PRELOAD, PS1, ACCEPT_KEYWORDS), the |
40 |
variable is changed for the current login shell session, but is not |
41 |
persistent. Period. That has nothing to do with Portage or any program, |
42 |
that's how Linux works. Variables are permanently set in configuration |
43 |
files (in the case of ACCEPT_KEYWORDS, in /etc/make.conf, with |
44 |
modifications allowed from /etc/portage/package.keywords). |
45 |
|
46 |
Most of the time, the temporary nature of this change can be assumed |
47 |
without thinking-- if the startup script for Neverwinter Nights includes an |
48 |
|
49 |
export LD_LIBRARY_PATH=./lib:./miles:$LD_LIBRARY_PATH |
50 |
|
51 |
command, the fact that it's temporary doesn't matter, because it only |
52 |
needs to be in effect while I'm running Neverwinter Nights, which is a |
53 |
temporary condition. |
54 |
|
55 |
This is completely different from the state of the Portage tree and your |
56 |
world file when running emerge. Basically, when you use ACCEPT_KEYWORDS |
57 |
on the command line, you are changing a variable temporarily, which |
58 |
Portage then reads, but because the condition does not persist-- and the |
59 |
state of Portage variables must persist across sessions-- you're |
60 |
essentially confusing Portage, which must rely on you to have a stable |
61 |
list of variable conditions in order for it to know what it's doing. |
62 |
This is not a flaw in Portage, it's just how it's constructed, and it |
63 |
really couldn't be constructed any better than it is-- it already does a |
64 |
lot more than one might have thought possible in terms of being flexible |
65 |
and 'pushing the envelope'. |
66 |
|
67 |
But the conditions of the environment must be respected. There is no way |
68 |
for Portage to become aware that you exported a variable prior to |
69 |
running the emerge command, and so there is no way for Portage to |
70 |
automatically add the --oneshot switch if you had done so, in the same |
71 |
way that "--update implies --pretend" or whichever switch it is that |
72 |
implies another, so the second switch is automatically added if the |
73 |
first is present. Because (export) ACCEPT_KEYWORDS is not part of the |
74 |
emerge command, and the emerge command can only adjust itself, based on |
75 |
its own settings, not other settings that you have manually adjusted |
76 |
prior to running the command. |
77 |
|
78 |
If you see what I mean. |
79 |
|
80 |
Anyway, I could be totally wrong, but I think it hangs together, and I |
81 |
suspect it is in fact the case. |
82 |
|
83 |
Perhaps it could be better explained to people, though, so that they |
84 |
understood the relationship between the variables that Portage is |
85 |
reading and the commands that one might run to modify them. Of course, a |
86 |
good thorough grounding in shell operations would take care of that, |
87 |
too, I suppose.... |
88 |
|
89 |
Holly |
90 |
-- |
91 |
gentoo-user@g.o mailing list |