Joshua Hoblitt <jhoblitt ifa.hawaii.edu> posted
20070703005516.GD15998 ifa.hawaii.edu, excerpted below, on Mon,
02 Jul
2007 14:55:16 -1000:
> On Tue, Jul 03, 2007 at 03:39:11AM +0300, Daniel Iliev
wrote:
>> On Mon, 2 Jul 2007 14:06:25 -1000
>> Joshua Hoblitt <jhoblitt ifa.hawaii.edu> wrote:
>>
>> > Is there a CLI utility to add/remove values
from 'world' without
>> > causing packages to be emerged/unemerged?
Even the emerge --inject
>> > functionality is gone. Or for that mater, is
there even a way of
>> > listing what's in world? I've gotten into the
habit of editing
>> > /var/lib/portage/world by hand but I always
feel 'dirty' for doing
>> > this.
>> >
>> > -J
>> >
>> > --
>>
>>
>> From "man emerge"
>>
>> --noreplace (-n)
>> Skips the packages specified on the
command-line that have
>> already been installed. Without this
option, any packages,
>> ebuilds, or deps you specify on the
command-line will cause
>> Portage to remerge the package, even if it
is already installed.
>> Note that Portage will not remerge
dependencies by default.
>>
>> This adds packages to "world". I manually
edit the file when I want to
>> remove some packages from "world" w/o
actually uninstalling them.
>
> Yes, I agree that -n will causes packages to be added
to world but it
> also causes them to be emerged immediately which is not
always desired.
> A practically example of this usage case is where your
about to run an
> `emerge -DNuva world` or `emerge -e world` and you want
to make
> modifications to 'world'.
Also take a look at dep, from the app-portage/udept package.
It has some
nice functionality, like cleaning up unneeded entries in
your world
file. OTOH, some of its functionality doesn't work quite
right... the
spring-clean option, for instance, is similar to emerge
--depclean, only
not quite as safe. Apparently its dependency resolver
misses certain
dependencies. (I'm guessing it sees the ones in the ebuilds
themselves
but misses some or all that are pulled in by the eclasses,
that are
therefore not listed specifically in the ebuilds.) Thus,
always use it
with -p (pretend, same as emerge) first, and check its list
for sanity.
Actually, with any of that sort of tools, emerge --depclean,
dep --spring-
clean, dep --pruneworld, revdep-rebuild, anything like that,
I prefer to
use the --pretend, and then issue the commands to do what
needs done
manually. I don't normally let any of those programs do
what they want
to do on their own, just using the --pretend to get a list
of things I
need to take care of manually.
As for handling my world file, my normal portage aliases all
have
--oneshot as one of the options, so I don't have to worry
about adding
non-leaf dependencies to the world file in my routine
merging. I have
special aliases that subtract the --oneshot, thus adding the
package to
the world file, if I want to do so. I have a special alias
that does the
--noreplace thing too, when I've merged the package and
decide I want to
add it to world after all. That gives me a way to "try
out" new
packages, just merging them with my normal aliases (so with
--oneshot) to
try them out, then if I've forgotten about them, the next
time I run
emerge --pretend --depclean, they show up there, and I can
decide whether
I want to keep them, adding them to my world file with
emerge --
noreplace, or not, in which case I do an emerge --unmerge.
OK, this is wandering the thread a bit, but my alias system
works like
this. At the base, I have two sets, ea* and ep*, for emerge
--ask and
emerge --pretend. As I said, I normally use --oneshot as
well, so if I
want to add it to the world file, I use ea2 (the 2
indicating NOT
oneshot). If it's already merged and I want to just add it
to the world
file (with --noreplace), I use eadd.
Also, one of my favorite portage features is
FEATURES=buildpkg, which I
leave enabled, so I have binary packages of everything I've
built.
That's handy if I want to quickly try an old version or
compare say the
default config files from one version to the next.
(portage's packages
are just tar.bz2-ed tarballs with a bit of extra metadata on
the end, so
anything that can browse bz2ed tarballs can browse the
packages. I use
app-misc/mc, aka midnight commander, for that, and most of
the rest of my
sysadmin type work as well.) Thus, I have a bunch of
aliases for working
with packages ( --usepkg and --usepkgonly) as well. (I
reverse the -k
and -K, since I /usually/ want --usepkgonly, -K, and thus
consider it
normal.)
The complete list:
ep*
####################
ep
exec emerge -pv $*
eplog
exec emerge -pvl $*
eplogsys
exec emerge -pvl system
eplogworld
exec emerge -pvl world
eppak
exec emerge -pvK $*
eppaK
exec emerge -pvk $*
epsys
exec emerge -pvNuD system
epworld
exec emerge -pvNuD world
eptree
exec emerge -pvNuDt $*
eptreeworld
exec emerge -pvNuDt world
(I've seen no need for the corresponding eptreesys, so don't
have it.)
ea*
#################
ea
exec emerge -av1 $*
ea2
exec emerge -av $*
eadd
exec emerge -avn $*
eaf
exec emerge -aNuDf $*
eafsys
exec emerge -aNuDf system
eafworld
exec emerge -aNuDf world
eapak
exec emerge -avK1 $*
eapaK
exec emerge -avk1 $*
eapak2
exec emerge -avK $*
eapaK2
exec emerge -avk $*
easys
exec emerge -avNuD system
eaworld
exec emerge -avNuD world
eatree
exec emerge -avt1 $*
eatree2
exec emerge -avt $*
eatreesys
exec emerge -avNuDt system
eatreeworld
exec emerge -avNuDt world
Then, I have a bashcompletion add-on that extends the Gentoo
bash_completion package, so I can use tab-completion on all
the above,
and just put in a few letters of the appropriate package and
hit the tab
key to either autocomplete or give me a listing of all the
possibilities.
What makes it great is that all I have to know is whether
I'm pretending,
or want to actually do it (with a confirming ask, of
course). Then I can
hit ea<tab><tab> or ep<tab><tab> and
get a nice list of all the possible
commands to choose from. After choosing the command, my
normal options
are already part of the alias, so I don't worry about adding
them, and
can simply add the package, a few letters,
<tab><tab>, and away I go.
Also nice is that I can run a command with ep*, then hit the
up-arrow to
recall the command, change the p to an a, and run it. If I
don't want to
see the prompt as I've just run the pretend, I just hit
enter twice
instead of only once, and it continues past the prompt.
All in all, the system has been a great timesaver for me.
=8^)
--
Duncan - List replies preferred. No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."
Richard Stallman
--
gentoo-amd64 gentoo.org mailing list
|