Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
SUGGESTION: /usr/portage/distfiles cleanup utility
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
SecretMethod70
n00b
n00b


Joined: 01 Mar 2003
Posts: 22
Location: Chicagoland

PostPosted: Wed Mar 05, 2003 10:07 am    Post subject: SUGGESTION: /usr/portage/distfiles cleanup utility Reply with quote

I was reading THIS THREAD and got an idea.

While I know there is a script in there to clean up the directory, I think it would be excellent if someone were to program a utility for this. I would do it myself, but I do not have programming skills. Here are my thoughts:

The program would have a GUI front-end, but would be able to be run from command line as well. I'll describe my thoughts on the GUI as it describes what the command line would be capable of as well.

Basically, you would have the option of deleting files from /usr/portage/distfiles based on date or size of the directory. If the option for "based on size" is checked in the GUI, you would have a slider where you can designate a maximum acceptable size for /usr/portage/distfiles ranging from 0 MB to whatever the total size of the partition is (obviously, actually bringing the slider to this point would be meaningless as it would essentially nullify the function of the clean up program). When you run the program it would delete files from the directory - starting from the oldest - until it was under the size you set.

You could also select to delete files from the directory based on date, setting a particular date where all files in the directory from before then are deleted.

Furthermore, you can select both options so that if files get old OR if the directory gets to large, things are deleted.

In a second tab, there would be scheduling options where you can select to check the directory every X weeks on certain days.

Of course, all of this, ideally, should also be able to be done through the command line. My thoughts is that it ought to be an addition to emerge as another parameter - something like "emerge --dfclean"

Any thoughts on this? Anyone willing to rogram this? I think it'd be a great addition to Gentoo and the portage system, making it easier to avoid the files downloaded from emerge taking up too much space.

Here are some quick sketches I made and threw up on geocities as to what I was thinking:

(you'll need to copy and paste the URL to see the images)

http://www.geocities.com/secretmethod70/dfclean.png
http://www.geocities.com/secretmethod70/dfclean2.png


Last edited by SecretMethod70 on Fri Mar 07, 2003 2:01 am; edited 1 time in total
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Wed Mar 05, 2003 1:53 pm    Post subject: Reply with quote

Cleaning out stale distfiles might be a good CLI base.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
SecretMethod70
n00b
n00b


Joined: 01 Mar 2003
Posts: 22
Location: Chicagoland

PostPosted: Thu Mar 06, 2003 12:30 pm    Post subject: Reply with quote

hmm....this concept seems not to be getting much response here. Is there a better place I should post this suggestion?
Back to top
View user's profile Send private message
markyd
n00b
n00b


Joined: 16 Apr 2002
Posts: 44

PostPosted: Tue Mar 18, 2003 4:13 am    Post subject: What I use. Reply with quote

Hey guys,
This is the code I use and i find that it works perfectly, at least on my system. :D

It will even download the newer/missing sources if they were not stored in your dist directory.

Code:

DIST_TMP="/tmp/olddist"
DIST_DIR="/usr/portage/distfiles"
OTHER_PKG="lftp emu10k1"

mkdir $DIST_TMP
mv $DIST_DIR/* $DIST_TMP

export FETCHCOMMAND="/bin/mv $DIST_TMP/\`/bin/echo \${URI}|/bin/sed -e 's/^.*\/\([^/]*\)$/\1/'\` \${DISTDIR} || /usr/bin/wget -t 5 --passive-ftp \${URI} -P \${DISTDIR}"
export RESUMECOMMAND="/bin/mv  $DIST_TMP/\`/bin/echo \${URI}|/bin/sed -e 's/^.*\/\([^/]*\)$/\1/'\` \${DISTDIR} && /usr/bin/wget -t 5 --passive-ftp \${URI} -P \${DISTDIR}"

emerge -e --update --deep --fetchonly world
emerge -e --update --deep --fetchonly $OTHER_PKG

unset RESUMECOMMAND FETCHCOMMAND
echo "$DIST_DIR is now clean of stale files"
echo "Please review then delete $DIST_TMP by typing rm -rf $DIST_TMP"
echo "Packages like dev-java/sun-jdk do not correctly list source files needed"


Just set the variables and away you go.

DIST_DIR is where your dist files are stored.
DIST_TMP is a temp directory for storing the dist files (bust not be subdir of DIST_DIR).
OTHER_PKG is other sources that are not part of world that you want to keep.

Enjoy,
Mark
Back to top
View user's profile Send private message
plate
Bodhisattva
Bodhisattva


Joined: 25 Jul 2002
Posts: 1663
Location: Berlin

PostPosted: Tue Mar 18, 2003 4:23 am    Post subject: Reply with quote

Followups go here, please: Cleaning out stale distfiles.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads 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