Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
AT3: Can I exclude parts of the Portage tree?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Frequently Asked Questions
View previous topic :: View next topic  
Author Message
curtis119
Bodhisattva
Bodhisattva


Joined: 10 Mar 2003
Posts: 2160
Location: Toledo, Ohio,USA, North America, Earth, SOL System, Milky Way, The Universe, The Cosmos, and Beyond.

PostPosted: Wed Jul 06, 2005 6:40 am    Post subject: AT3: Can I exclude parts of the Portage tree? Reply with quote

Navigation: [Advanced Topics] [Table of Contents]

Question: The portage tree takes up too much space with stuff I won't ever install and takes a long time to sync. What can I do?

The time Portage takes to download and process the tree (/usr/portage) can be decreased very easily by excluding parts of it. This will also free up valuable disk space since the portage tree is now over 400MB. This feature is available in portage-2.0.47-r3 and higher.

First add or uncomment the following line to /etc/make.conf

Code:

# For portage-2.0.x
RSYNC_EXCLUDEFROM=/etc/portage/rsync_excludes
# For portage-2.1
PORTAGE_RSYNC_EXTRA_OPTS="--exclude-from=/etc/portage/rsync_excludes"



Next create the rsync_exludes file in /etc/portage and add the categories you want to exclude. Here is an example file that excludes all of the games categories, kde and media-sound.

Code:

games-*/
kde-*/
media-sound/


Portage will not delete these directories if they already exist so you must manually remove them. Once removed portage will not recreate them. For example:

Code:

rm -rf /usr/portage/games-action


Adding "--delete-excluded" to PORTAGE_RSYNC_EXTRA_OPTS, which will automatically delete directories added to the "--exclude-from" file on the next emerge --sync, will also delete all the files in distdir, since portage already excludes that directory. Deleting all the files in distdir on every emerge --sync is probably not what you want so manual deletion, as shown above, is recommended.

If you are attempting to emerge a package and get an error about missing dependencies check that it is not included in a category you excluded. You may add or remove categories from the rsync_exludes file at any time but it will not take effect until your next sync. To regain the entire portage tree simply comment out the RSYNC_EXCLUDEFROM or PORTAGE_RSYNC_EXTRA_OPTS line in /etc/make.conf and emerge --sync. Be careful not to exclude needed categories such as sys-apps.

For advanced information on directory/file pattern matching in your rsync_exludes file read the section "include/exclude pattern rules" in the rsync manpage. You can also try the script in this post (use at your own risk).

2006-06-16: Portage-2.1 changes, minor touch up. --kallamej
2006-07-05added note about "--delete-excluded" --curtis119[/i]
_________________
Gentoo: it's like wiping your ass with silk.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Frequently Asked Questions 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