Mailinglist Archive: opensuse-buildservice (262 mails)

< Previous Next >
Re: [opensuse-buildservice] osc package cache dir cleanup
  • From: MasterPatricko <masterpatricko@xxxxxxxxx>
  • Date: Tue, 04 Aug 2009 19:30:28 +0100
  • Message-id: <4A787E44.9070803@xxxxxxxxx>
Kyrill Detinov wrote:
Sunday 02 August 2009

Hello.

Is there any simple way (maybe script) to delete obsolete versions of
packages from local osc package cache directory?


Here's a very simple draft I wrote more as an experiment in bash
progress indicators than anything else.

Its grossly inefficient and probably shows off lots of bad bash habits
but it sortof works and might be a good start for what you are thinking of.

It assumes the directory you want to clean is
/var/tmp/osbuild-packagecache. It uses find & rpm to create a whole
bunch of text files which it then sorts to decide which files to keep.
It runs much much faster if you run it in --quiet or --noprogressind mode.

Regards,

MasterPatricko
< Previous Next >
Follow Ups
References