Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Eclean and Shared Portage
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
CCMCornell
n00b
n00b


Joined: 28 May 2006
Posts: 39

PostPosted: Thu Oct 25, 2007 11:06 pm    Post subject: Eclean and Shared Portage Reply with quote

I have a shared portage tree over NFS for my two Gentoo machines. I just read about eclean to clean up unneeded distfiles and packages. Is there a way to run eclean so that it removes distfiles no longer needed by either system? I thought maybe there would be a way to somehow import the list of files to keep from, say, box #2 and add them to /etc/eclean/distfiles.exclude on box #1 and then run eclean on box #1, but that's beyond my know-how.
Back to top
View user's profile Send private message
timeBandit
Bodhisattva
Bodhisattva


Joined: 31 Dec 2004
Posts: 2719
Location: here, there or in transit

PostPosted: Mon Oct 29, 2007 7:30 pm    Post subject: Reply with quote

I don't believe that behavior is built-in.

Let's call box #1 the machine that hosts the Portage tree, and box #2 the one that mounts the tree via NFS. Here's the easiest method that comes to mind:
On Box #1:
cd /usr/portage
mkdir dist-all box1 box2
ln distfiles/* dist-all
Please note that's just ln, not ln -s. You must create hard links for this.

Still on Box #1:
eclean
ln distfiles/* box1
find dist-all -type f -links 1 -exec ln "{}" distfiles \;
You now have all distfiles needed by box #1 linked in /usr/portage/box1, and have restored /usr/portage/distfiles to its original state (as if you never ran eclean).

On Box #2:
eclean
Your shared /usr/portage/distfiles now reflects only what's needed by box #2. However, all distfiles are still linked from dist-all, so those needed only by box #1 aren't really gone yet.

Back on Box #1:
ln distfiles/* box2
find dist-all -type f -links 1 -delete
That identifies and removes from ./dist-all those files not used by either box. They have a hard-link count of 1 because they are not linked from ./box1 nor ./box2. You now have:
  • All distfiles needed by box #1 in /usr/portage/box1
  • All distfiles needed by box #2 in /usr/portage/box2 (and /usr/portage/distfiles)
  • All distfiles needed by either or both boxes in /usr/portage/dist-all.
You need only the last set, so remove the rest:
Still on Box #1:
rm -rf distfiles box1 box2
mv dist-all distfiles
...and Bob's your uncle. :)
_________________
Plants are pithy, brooks tend to babble--I'm content to lie between them.
Super-short f.g.o checklist: Search first, strip comments, mark solved, help others.
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6780

PostPosted: Mon Oct 29, 2007 7:54 pm    Post subject: Reply with quote

With trickyfetch:
Code:
cd $DISTDIR
mkdir .obsolete
mv * .obsolete
emerge -feD world (on machine 1)
emerge -feD world (on machine 2)
rm .obsolete/*
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