View previous topic :: View next topic |
Author |
Message |
SecretMethod70 n00b
Joined: 01 Mar 2003 Posts: 22 Location: Chicagoland
|
Posted: Wed Mar 05, 2003 10:07 am Post subject: SUGGESTION: /usr/portage/distfiles cleanup utility |
|
|
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 |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20067
|
Posted: Wed Mar 05, 2003 1:53 pm Post subject: |
|
|
Cleaning out stale distfiles might be a good CLI base. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
SecretMethod70 n00b
Joined: 01 Mar 2003 Posts: 22 Location: Chicagoland
|
Posted: Thu Mar 06, 2003 12:30 pm Post subject: |
|
|
hmm....this concept seems not to be getting much response here. Is there a better place I should post this suggestion? |
|
Back to top |
|
|
markyd n00b
Joined: 16 Apr 2002 Posts: 44
|
Posted: Tue Mar 18, 2003 4:13 am Post subject: What I use. |
|
|
Hey guys,
This is the code I use and i find that it works perfectly, at least on my system.
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 |
|
|
plate Bodhisattva
Joined: 25 Jul 2002 Posts: 1663 Location: Berlin
|
|
Back to top |
|
|
|