View previous topic :: View next topic |
Author |
Message |
CCMCornell n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 28 May 2006 Posts: 39
|
Posted: Thu Oct 25, 2007 11:06 pm Post subject: Eclean and Shared Portage |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
timeBandit Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/7370479114aa9a876e87b5.png)
Joined: 31 Dec 2004 Posts: 2719 Location: here, there or in transit
|
Posted: Mon Oct 29, 2007 7:30 pm Post subject: |
|
|
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).
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. ![Smile :)](images/smiles/icon_smile.gif) _________________ 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 |
|
![](templates/gentoo/images/spacer.gif) |
mv Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
![](images/avatars/169262237648b51b40d0ec0.png)
Joined: 20 Apr 2005 Posts: 6780
|
Posted: Mon Oct 29, 2007 7:54 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
|
|
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
|
|