[opensuse-factory] Script to remove excess rpm packages?

Hi. Here's my situation: I have a test machine which I update once or twice a week. I save the update rpms, and when important things are in sync (I can run vmware, for example), I take the saved rpms over to my work machine and do an update there. It has been such a long time since I've updated the work machine that I have 100,000 update rpms for an installed base of 10,000 packages. Some of the package updates have 15-20 versions. I've tried, but it takes forever to "thin out the herd", so there's at most a couple of versions so that the update solver isn't going to run forever trying to figure out what to do. Does anyone have a script that will reduce the number of versions of each package down to one or two? Thanks, Steve CASA-1.7.1592-4.10.i586.rpm CASA-1.7.1592-4.14.i586.rpm CASA-1.7.1592-4.17.i586.rpm CASA-1.7.1592-4.19.i586.rpm CASA-1.7.1592-4.20.i586.rpm CASA-1.7.1592-4.21.i586.rpm CASA-1.7.1592-4.22.i586.rpm CASA-1.7.1592-4.23.i586.rpm CASA-1.7.1592-4.24.i586.rpm CASA-1.7.1592-4.26.i586.rpm CASA-1.7.1592-4.27.i586.rpm CASA-1.7.1592-4.28.i586.rpm CASA-1.7.1592-4.29.i586.rpm CASA-1.7.1592-4.32.i586.rpm CASA-1.7.1592-4.33.i586.rpm CASA-1.7.1592-4.36.i586.rpm CASA-1.7.1592-4.42.i586.rpm CASA-1.7.1592-4.9.i586.rpm Limit it to -4.42, or -4.36 and -4.42, for example. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-factory+help@opensuse.org

Hi Space, On Tue, 27 Oct 2009 20:53:28 -0700 wormey@eskimo.com (Space Case) wrote:
Does anyone have a script that will reduce the number of versions of each package down to one or two?
I used this one to clean up the osc build package cache, back when I was young and stupid and still test-building against FACTORY ;) seife@strolchi:~> cat bin/clean-osbuild-packagecache.sh #!/bin/sh DIR=$1 if [ -z "$DIR" ]; then echo "please give directory!" exit 1 fi cd $DIR PKGS=$(ls |sed 's/-[[:digit:]].*-[[:digit:]].*\.rpm//'| sort -u) for i in $PKGS; do ls -t ${i}-[0-9]*-[0-9]*.rpm|tail -n +2|xargs --no-run-if-empty rm done ##### This actually goes for the timestamp of the Packages IIRC and it was not 100% perfect, but it served my purpose (reducing the amount of disk space wasted by osc) well. -- Stefan Seyfried "Any ideas, John?" "Well, surrounding them's out." -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-factory+help@opensuse.org

On Wed, 28 Oct 2009 12:09:09 -0300 Cristian Rodríguez <crrodriguez@opensuse.org> wrote:
IMHO this is a bug, osc build should clean older packages.
"should" as in "it should do this but does not for some reason" or "should" as in "somebody should implement that osc build cleans up older packages"? I have to admit that I did not have the problem in recent versions, but simply because I just test-build against latest-released-product and then submit to FACTORY and hope that it does not blow up ;) -- Stefan Seyfried "Any ideas, John?" "Well, surrounding them's out." -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-factory+help@opensuse.org

On Wed, 28 Oct 2009 12:27:46 -0300 Cristian Rodríguez <crrodriguez@opensuse.org> wrote:
Ok. Do I need a special "cleanup" command or should it just clean up old crap when it downloads new?
then submit to FACTORY and hope that it does not blow up ;)
It may blow up. heh ;)
Well, this is why I test in my home project before submitreq'ing ;) -- Stefan Seyfried "Any ideas, John?" "Well, surrounding them's out." -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-factory+help@opensuse.org
participants (3)
-
Cristian Rodríguez
-
Stefan Seyfried
-
wormey@eskimo.com