1 |
Joshua Hoblitt <jhoblitt@××××××××××.edu> posted |
2 |
20070703005516.GD15998@××××××××××.edu, excerpted below, on Mon, 02 Jul |
3 |
2007 14:55:16 -1000: |
4 |
|
5 |
> On Tue, Jul 03, 2007 at 03:39:11AM +0300, Daniel Iliev wrote: |
6 |
>> On Mon, 2 Jul 2007 14:06:25 -1000 |
7 |
>> Joshua Hoblitt <jhoblitt@××××××××××.edu> wrote: |
8 |
>> |
9 |
>> > Is there a CLI utility to add/remove values from 'world' without |
10 |
>> > causing packages to be emerged/unemerged? Even the emerge --inject |
11 |
>> > functionality is gone. Or for that mater, is there even a way of |
12 |
>> > listing what's in world? I've gotten into the habit of editing |
13 |
>> > /var/lib/portage/world by hand but I always feel 'dirty' for doing |
14 |
>> > this. |
15 |
>> > |
16 |
>> > -J |
17 |
>> > |
18 |
>> > -- |
19 |
>> |
20 |
>> |
21 |
>> From "man emerge" |
22 |
>> |
23 |
>> --noreplace (-n) |
24 |
>> Skips the packages specified on the command-line that have |
25 |
>> already been installed. Without this option, any packages, |
26 |
>> ebuilds, or deps you specify on the command-line will cause |
27 |
>> Portage to remerge the package, even if it is already installed. |
28 |
>> Note that Portage will not remerge dependencies by default. |
29 |
>> |
30 |
>> This adds packages to "world". I manually edit the file when I want to |
31 |
>> remove some packages from "world" w/o actually uninstalling them. |
32 |
> |
33 |
> Yes, I agree that -n will causes packages to be added to world but it |
34 |
> also causes them to be emerged immediately which is not always desired. |
35 |
> A practically example of this usage case is where your about to run an |
36 |
> `emerge -DNuva world` or `emerge -e world` and you want to make |
37 |
> modifications to 'world'. |
38 |
|
39 |
Also take a look at dep, from the app-portage/udept package. It has some |
40 |
nice functionality, like cleaning up unneeded entries in your world |
41 |
file. OTOH, some of its functionality doesn't work quite right... the |
42 |
spring-clean option, for instance, is similar to emerge --depclean, only |
43 |
not quite as safe. Apparently its dependency resolver misses certain |
44 |
dependencies. (I'm guessing it sees the ones in the ebuilds themselves |
45 |
but misses some or all that are pulled in by the eclasses, that are |
46 |
therefore not listed specifically in the ebuilds.) Thus, always use it |
47 |
with -p (pretend, same as emerge) first, and check its list for sanity. |
48 |
Actually, with any of that sort of tools, emerge --depclean, dep --spring- |
49 |
clean, dep --pruneworld, revdep-rebuild, anything like that, I prefer to |
50 |
use the --pretend, and then issue the commands to do what needs done |
51 |
manually. I don't normally let any of those programs do what they want |
52 |
to do on their own, just using the --pretend to get a list of things I |
53 |
need to take care of manually. |
54 |
|
55 |
As for handling my world file, my normal portage aliases all have |
56 |
--oneshot as one of the options, so I don't have to worry about adding |
57 |
non-leaf dependencies to the world file in my routine merging. I have |
58 |
special aliases that subtract the --oneshot, thus adding the package to |
59 |
the world file, if I want to do so. I have a special alias that does the |
60 |
--noreplace thing too, when I've merged the package and decide I want to |
61 |
add it to world after all. That gives me a way to "try out" new |
62 |
packages, just merging them with my normal aliases (so with --oneshot) to |
63 |
try them out, then if I've forgotten about them, the next time I run |
64 |
emerge --pretend --depclean, they show up there, and I can decide whether |
65 |
I want to keep them, adding them to my world file with emerge -- |
66 |
noreplace, or not, in which case I do an emerge --unmerge. |
67 |
|
68 |
OK, this is wandering the thread a bit, but my alias system works like |
69 |
this. At the base, I have two sets, ea* and ep*, for emerge --ask and |
70 |
emerge --pretend. As I said, I normally use --oneshot as well, so if I |
71 |
want to add it to the world file, I use ea2 (the 2 indicating NOT |
72 |
oneshot). If it's already merged and I want to just add it to the world |
73 |
file (with --noreplace), I use eadd. |
74 |
|
75 |
Also, one of my favorite portage features is FEATURES=buildpkg, which I |
76 |
leave enabled, so I have binary packages of everything I've built. |
77 |
That's handy if I want to quickly try an old version or compare say the |
78 |
default config files from one version to the next. (portage's packages |
79 |
are just tar.bz2-ed tarballs with a bit of extra metadata on the end, so |
80 |
anything that can browse bz2ed tarballs can browse the packages. I use |
81 |
app-misc/mc, aka midnight commander, for that, and most of the rest of my |
82 |
sysadmin type work as well.) Thus, I have a bunch of aliases for working |
83 |
with packages ( --usepkg and --usepkgonly) as well. (I reverse the -k |
84 |
and -K, since I /usually/ want --usepkgonly, -K, and thus consider it |
85 |
normal.) |
86 |
|
87 |
The complete list: |
88 |
|
89 |
ep* |
90 |
#################### |
91 |
|
92 |
ep |
93 |
exec emerge -pv $* |
94 |
|
95 |
eplog |
96 |
exec emerge -pvl $* |
97 |
|
98 |
eplogsys |
99 |
exec emerge -pvl system |
100 |
|
101 |
eplogworld |
102 |
exec emerge -pvl world |
103 |
|
104 |
eppak |
105 |
exec emerge -pvK $* |
106 |
|
107 |
eppaK |
108 |
exec emerge -pvk $* |
109 |
|
110 |
epsys |
111 |
exec emerge -pvNuD system |
112 |
|
113 |
epworld |
114 |
exec emerge -pvNuD world |
115 |
|
116 |
eptree |
117 |
exec emerge -pvNuDt $* |
118 |
|
119 |
eptreeworld |
120 |
exec emerge -pvNuDt world |
121 |
|
122 |
(I've seen no need for the corresponding eptreesys, so don't have it.) |
123 |
|
124 |
ea* |
125 |
################# |
126 |
|
127 |
ea |
128 |
exec emerge -av1 $* |
129 |
|
130 |
ea2 |
131 |
exec emerge -av $* |
132 |
|
133 |
eadd |
134 |
exec emerge -avn $* |
135 |
|
136 |
eaf |
137 |
exec emerge -aNuDf $* |
138 |
|
139 |
eafsys |
140 |
exec emerge -aNuDf system |
141 |
|
142 |
eafworld |
143 |
exec emerge -aNuDf world |
144 |
|
145 |
eapak |
146 |
exec emerge -avK1 $* |
147 |
|
148 |
eapaK |
149 |
exec emerge -avk1 $* |
150 |
|
151 |
eapak2 |
152 |
exec emerge -avK $* |
153 |
|
154 |
eapaK2 |
155 |
exec emerge -avk $* |
156 |
|
157 |
easys |
158 |
exec emerge -avNuD system |
159 |
|
160 |
eaworld |
161 |
exec emerge -avNuD world |
162 |
|
163 |
eatree |
164 |
exec emerge -avt1 $* |
165 |
|
166 |
eatree2 |
167 |
exec emerge -avt $* |
168 |
|
169 |
eatreesys |
170 |
exec emerge -avNuDt system |
171 |
|
172 |
eatreeworld |
173 |
exec emerge -avNuDt world |
174 |
|
175 |
Then, I have a bashcompletion add-on that extends the Gentoo |
176 |
bash_completion package, so I can use tab-completion on all the above, |
177 |
and just put in a few letters of the appropriate package and hit the tab |
178 |
key to either autocomplete or give me a listing of all the possibilities. |
179 |
|
180 |
What makes it great is that all I have to know is whether I'm pretending, |
181 |
or want to actually do it (with a confirming ask, of course). Then I can |
182 |
hit ea<tab><tab> or ep<tab><tab> and get a nice list of all the possible |
183 |
commands to choose from. After choosing the command, my normal options |
184 |
are already part of the alias, so I don't worry about adding them, and |
185 |
can simply add the package, a few letters, <tab><tab>, and away I go. |
186 |
|
187 |
Also nice is that I can run a command with ep*, then hit the up-arrow to |
188 |
recall the command, change the p to an a, and run it. If I don't want to |
189 |
see the prompt as I've just run the pretend, I just hit enter twice |
190 |
instead of only once, and it continues past the prompt. |
191 |
|
192 |
All in all, the system has been a great timesaver for me. =8^) |
193 |
|
194 |
-- |
195 |
Duncan - List replies preferred. No HTML msgs. |
196 |
"Every nonfree program has a lord, a master -- |
197 |
and if you use the program, he is your master." Richard Stallman |
198 |
|
199 |
-- |
200 |
gentoo-amd64@g.o mailing list |