Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Emerge -e world, minus whatever
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
G2k
l33t
l33t


Joined: 06 Mar 2004
Posts: 672
Location: Rome, Italy

PostPosted: Sun May 29, 2005 1:51 pm    Post subject: Emerge -e world, minus whatever Reply with quote

I came up with this mini howto for those of you who want to emerge your world file from scratch but would like to exclude certain files in the process.
It was useful for me since I emerged the unstable gcc (3.4.3) and then re-emerged the toolchain by hand. Then I wanted to do an 'emerge -e world' so that my whole system could be compiled with it, but had I done that I would have had to re-compile the toolchain. Since compiling everything agian seemed a bit much, I came up with a rather simple way to get this done quickly. Hope it can be useful to some of you.

First of all, I printed out all the files that the emerge would compile to a file of my choice:
Code:
# emerge -ep world | grep ebuild > ~/emerge.txt

I then used this sed command to parse the file in order to get rid of all the "[ebuild N ] " from each line and replace them with a "=", which the emerge command will have an easier time reading afterwards
Code:
sed -e 's/\[ebuild  N    \] /=/g' < ~/emerge.txt > ~/emerge2.txt && rm ~/emerge.txt && mv ~/emerge2.txt ~/emerge.txt
(There has to be a cleaner way to do this but this is what I was able to come up with)

This is where the fun part comes :o delete all lines of files which you would like to exclude from the emerge process.
Code:
# vim ~/emerge.txt
(Obviously you have to replace vim with your editor of choice) I, for example, removed all packages that belong to the toolchain (glibc, linux-headers, gcc, gcc-config, etc.) and also some other files that I really didn't want to emerge now such as openoffice. Once you have removed the packages you don't want to emerge, simply run a
Code:
emerge -1 `cat ~/emerge.txt | xargs echo -n`
and it should rebuild your world file without compiling the unspecified. :wink:
_________________
Animula vagula blandula,
Hospes comesque corporis,
Quae nunc abibis in loca
Pallidula rigida nudula,
Nec ut soles dabis iocos...
- Imp. Caesar Hadrianus


Last edited by G2k on Thu Jun 30, 2005 5:32 pm; edited 4 times in total
Back to top
View user's profile Send private message
NorthWoodsman
Tux's lil' helper
Tux's lil' helper


Joined: 25 Apr 2003
Posts: 134

PostPosted: Sun May 29, 2005 4:50 pm    Post subject: Reply with quote

Wouldn't it be easier to just do

Quote:

cp /var/lib/portage/world ~
nano -w ~/world
cat ~/world | xargs -l1 emerge
Back to top
View user's profile Send private message
G2k
l33t
l33t


Joined: 06 Mar 2004
Posts: 672
Location: Rome, Italy

PostPosted: Sun May 29, 2005 4:57 pm    Post subject: Reply with quote

how is that doing an --emptytree world?
_________________
Animula vagula blandula,
Hospes comesque corporis,
Quae nunc abibis in loca
Pallidula rigida nudula,
Nec ut soles dabis iocos...
- Imp. Caesar Hadrianus
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum