Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Portage Directory Structure
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
rmsousa
n00b
n00b


Joined: 21 Mar 2003
Posts: 4

PostPosted: Fri Apr 04, 2003 10:54 pm    Post subject: Portage Directory Structure Reply with quote

I can't understand portage's directory structure.
by "cache" I understand something that can be deleted without harm, as it only saves you some downloads
And then I come across these things:

/var/cache/edb, which contains, among others, world, which CANNOT be deleted, as it is a configuration file (should be in /etc?)
/usr/portage/distfiles, which contains files which I can download at any time (should be cache?)
/usr/portage/x-y, which contains the ebuilds, that, again, can be downloaded again with an emerge sync (okay, a LOOOONG emerge sync, but anyway...)

That is : everything that is in /var/cache/edb/ should be in /var/lib/edb or /etc/edb
everything that is in /usr/portage (except profiles, eclass, scripts, etc) should be in /var/cache/portage

So, if I run _really_ low on HD space, I can just delete /var/cache, which, in my opinion, is expected behaviour.

Can someone enlighten me on why it isn't organised in this way (or a similar one)?
Back to top
View user's profile Send private message
David_Escott
l33t
l33t


Joined: 12 Jan 2003
Posts: 952
Location: Boston, MA

PostPosted: Fri Apr 04, 2003 11:59 pm    Post subject: Reply with quote

I think the cache here is refering to the fact that this enables portage to make lookups faster so it is in that sense a cache (just as a cpu cache is faster access than going to ram). I'm not entirely sure where portage does keep all its databases but the world file is in fact not an important file.

One thing to note is that distfiles should truly not be deleted in total like that. rather you should just delete the ones you dont need anymore. There are some scripts in the forums that do this.
Back to top
View user's profile Send private message
axxackall
l33t
l33t


Joined: 06 Nov 2002
Posts: 651
Location: Toronto, Ontario, 3rd Rock From Sun

PostPosted: Sat Apr 05, 2003 5:08 am    Post subject: Reply with quote

As far as I remember Unix, /usr was used to be a filesystem often mounted as read-only to keep all installed software files if they are not changeable between software reinstallations. As read-only it's less likey will be corrupted at system crash. It was remounted as writable only when a sysadm reinstalled something. Thus, /usr/portage was a good choice - it's a place where portage tree is installed. You reinstall the portage tree by "emerge rsync". However, re-installation of portage tree is not an exception, but rather a normal daily (at least weekly) based operation in Gentoo. Thus, if you resync often then it's a good idea to move /usr/portage to /var/lib/portage

/var in Unix was for changeable data, like databases. Like /var/cache/edb, which mostly keeps cached deps. /var/db/pkg keeps the database of currently installed packages. They are changed not because you resync the portage tree, but b/c you want to (re)install some package from the portage tree, after resync or after you just decided you need a new (version of) package. Means you do it much more often than you resync /usr/portage.

Let's thing about /var from DBA's point of view. Would you delete your Oracle or PostgreSQL DB when you have to free some space? No, you would not. Instead, you run sqlplus or psql and delete some records. Or you clean DB with some "defragmentation/vacuum" scripts. Same thing, you run some scripts which will clean up /var/cache/edb.

I agree /var/cache/edb is not exactly DB as you can rebuild it again anytime. Just it will take lots of time - that's why don't move it to /tmp or your boot will take really long time.

/tmp was for files which you can delete anytime. What's even more important, it's supposed to be cleaned up automatically after every reboot. However, I would not put any ebuild temp folders into /tmp as I may need them again after reboot. Otherwise, it might not a bad idea to move /var/tmp/portage to /tmp/portage
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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