[gentoo-amd64] Re: gcc 4.1.0, emerge -e world

2006-06-24 Thread Duncan
Brian Litzinger <[EMAIL PROTECTED]> posted
[EMAIL PROTECTED], excerpted below,
on  Fri, 23 Jun 2006 16:47:21 -0700:

> I suppose there is a clever way to do this, but here is what I do:
> 
> emerge -ep world > foo
> 
> Then I munge foo into a shell script with a bunch of individual emerge
> commands.
> 
> Then I just start at wherever it stopped.
> 
> If no one posts the clever or right way to do it, I'll send along
> my munging script.

I do much the same thing sometimes (most recently to rebuild all my
kde-base programs), but note that you don't actually have to run each
emerge as an individual command.  Once you get the list, you can simply
trim it to the names, one per line, and use a redirect to feed it back
into emerge.

This pretty much dumps a list of the packages (make it one line):

emerge -ep world|cut -d] -f2|cut -d" " -f2|grep /|sed -e s/^/=/ > pkglst

The first cut uses ] as the delimiter (-d]), cutting to the second field
(-f2), so everything to the left of ] gets dumped.

The second cut uses [space] as a delimiter, again cutting to the second
field, so leaves the category/package-version strings only (plus some
garbage lines at the top).

The grep / filters out the garbage lines (since all the lines we want have
a / between the category and package).

The sed inserts an "=" at the beginning of each line, as we will be
emerging specific versions.

The result is redirected to a file, pkglst, which you can then open in
your favorite editor and massage manually where necessary.

Once you have it right, try this:

emerge --nodeps -a1 $(cat pkglst)

If you've done it right, you should get a list of what it would merge,
and a prompt asking if you want to do it (the -a). The nodeps keeps portage
from having to calculate all those dependencies (thus making it spit out
the pretend faster), since we know it's right because the list is the same
one emerge spit out previously, in the same order.  The -1 (same as
--oneshot) tells portage not to add all that to the world file.  You don't
/want/ all that in the world file since some of those are dependencies
of what you really want, and dependencies can change.  The $(command)
sequence simply tells bash to substitute the output of command into the
command line, so we are simply using "cat pkglst" in the command line.

If it works, you can say yes and start the remerge.

There are a couple benefits to doing it this way.

One, any time the merge stops (or you decide to stop it), you can simply
delete the packages it has completed merging to that point from pkglst,
and rerun your merge command to finish the job.  emerge --resume works
similarly, but if you stop the process and run a different emerge command,
the different emerge command will erase the resume info so portage won't
know where it left off, while with the list, you track it manually,
deleting packages it's already merged before restarting, so emerge can't
lose track of where it was.  The list method also gives you a bit more
flexibility in terms of skipping some packages to remerge later, if
desired (see below).

Two, the above technique, modified slightly, can be very useful for
merging just a certain group of apps.  As mentioned, I used it to remerge
all of the kde-base packages I had emerged, not long ago.  All one has to
do is add an appropriate grep to the string of commands making the list. 
Taking my example (again, one line):

emerge -ep world|cut -d] -f2|cut -d" " -f2|grep /|grep kde-base/|sed -e
s/^/=/>pkglst

The extra "grep kde-base/" filters the list to only the kde-base category
packages, which conveniently are all the ones that make up the kde core
packages.

Note that I mentioned skipping packages, above.  If for that emerge
--emptytree world, you knew when you were creating the list that you wanted
to save all the kde-base packages to merge later, you could either edit
the list appropriately, or use the -v (everything /but/) grep option, as
below, then when you decided to remerge kde, use the above to get the list
of kde-base packages.  (The only difference between the above /only/ KDE,
and the below /everything/ /but/ KDE, is the -v grep option.)

emerge -ep world|cut -d] -f2|cut -d" " -f2|grep /|grep -v kde-base/|sed -e
s/^/=/>pkglst



-- 
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



Re: [gentoo-amd64] Re: gcc 4.1.0, emerge -e world

2006-06-24 Thread Barry . SCHWARTZ
Duncan <[EMAIL PROTECTED]> skribis:
> emerge --resume works
> similarly, but if you stop the process and run a different emerge command,
> the different emerge command will erase the resume info so portage won't
> know where it left off...

Another thing for the bag of tricks:

Run emerge --resume, suspend it, run the different emerge, then
continue the emerge --resume.


-- 
Barry.SCHWARTZ at chemoelectric.org   http://chemoelectric.org
Free stuff / Senpagaj varoj:  http://crudfactory.com (PDF)
'Democracies don't war; democracies are peaceful countries.' - Bush
(http://www.whitehouse.gov/news/releases/2005/12/20051219-2.html)


pgpaXOETOU6qb.pgp
Description: PGP signature


Re: [gentoo-amd64] Re: gcc 4.1.0, emerge -e world

2006-06-24 Thread Michael Weyershäuser
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

[EMAIL PROTECTED] wrote:
> Duncan <[EMAIL PROTECTED]> skribis:
>> emerge --resume works
>> similarly, but if you stop the process and run a different emerge command,
>> the different emerge command will erase the resume info so portage won't
>> know where it left off...
> 
> Another thing for the bag of tricks:
> 
> Run emerge --resume, suspend it, run the different emerge, then
> continue the emerge --resume.

Even easier: 'emerge --ask --resume', leave it asking it's question,
do your other emerge and then simply hit return on the asking emerge.

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFEnURF6q4f+IV6B/wRApJOAJ492muMegS3o2E3zPj08ky1OAZY2ACeMhKz
gTJ/K4AwKbQtBthuRWfYuVo=
=Lqr+
-END PGP SIGNATURE-
-- 
gentoo-amd64@gentoo.org mailing list



Re: [gentoo-amd64] Re: gcc 4.1.0, emerge -e world

2006-06-24 Thread Barry . SCHWARTZ
Michael Weyershäuser <[EMAIL PROTECTED]> skribis:
> [EMAIL PROTECTED] wrote:
> > Run emerge --resume, suspend it, run the different emerge, then
> > continue the emerge --resume.
> 
> Even easier: 'emerge --ask --resume', leave it asking it's question,
> do your other emerge and then simply hit return on the asking emerge.

Won’t it continue to ask you things, and so make it harder?

Personally, I find --ask extremely annoying.


-- 
Barry.SCHWARTZ at chemoelectric.org   http://chemoelectric.org
Free stuff / Senpagaj varoj:  http://crudfactory.com (PDF)
'Democracies don't war; democracies are peaceful countries.' - Bush
(http://www.whitehouse.gov/news/releases/2005/12/20051219-2.html)


pgpy6uZd7Iyc8.pgp
Description: PGP signature


Re: [gentoo-amd64] Re: gcc 4.1.0, emerge -e world

2006-06-24 Thread John Myers
On Saturday 24 June 2006 07:27, [EMAIL PROTECTED] wrote:
> Michael Weyershäuser <[EMAIL PROTECTED]> skribis:
> > [EMAIL PROTECTED] wrote:
> > > Run emerge --resume, suspend it, run the different emerge, then
> > > continue the emerge --resume.
> >
> > Even easier: 'emerge --ask --resume', leave it asking it's question,
> > do your other emerge and then simply hit return on the asking emerge.

> Won’t it continue to ask you things, and so make it harder?
I've only ever had --ask ask whether I wanted to continue after the --pretend 
output at the beginning
>
> Personally, I find --ask extremely annoying.

-- 
# 
# electronerd, the electronerdian from electronerdia
#


pgpZegaFtcT9b.pgp
Description: PGP signature


Re: [gentoo-amd64] Re: gcc 4.1.0, emerge -e world

2006-06-24 Thread Michael Weyershäuser
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

[EMAIL PROTECTED] wrote:
> 
> Won?t it continue to ask you things, and so make it harder?
> 
> Personally, I find --ask extremely annoying.
> 
- --ask tells you what it would do (the output of --pretend actually),
then stops and asks "Do you want to continue?". That's all, no more
questions asked after that. So if you usually run --pretend, take a
look if it is ok and then continue without --pretend it can save you
the time of calculating dependencies once...
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFEnVQs6q4f+IV6B/wRAsgpAJ9qxiWt2M3nLaC7PX/cW80hUK2QpwCfSvQR
kcTX/UYxbYABR8HZjBZWjtc=
=9xhu
-END PGP SIGNATURE-
-- 
gentoo-amd64@gentoo.org mailing list