[opensuse-buildservice] osc package cache dir cleanup
Sunday 02 August 2009 Hello. Is there any simple way (maybe script) to delete obsolete versions of packages from local osc package cache directory? -- WBR, Kyrill Detinov -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
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
Tuesday 04 August 2009 On Tuesday 04 August 2009 22:30:28 MasterPatricko wrote:
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.
Thanks for the script. I run it and got error: sort: invalid option -- 'V' As far as I can see there isn't option -V in sort help. What do you mean in sort -k2 -V "${txttempdir}/${txtfilename}"? -- WBR, Kyrill Detinov -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Wednesday 05 August 2009 On Tuesday 04 August 2009 23:29:53 Kyrill Detinov wrote:
I run it and got error: sort: invalid option -- 'V'
Got it. I run the script in 11.1 (my main system) with old version coreutils. Then boot 11.2 and it works! Cleaned 300+ Mb. Thank you very much! -- WBR, Kyrill Detinov -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Kyrill Detinov wrote:
Tuesday 04 August 2009
On Tuesday 04 August 2009 22:30:28 MasterPatricko wrote:
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.
Thanks for the script. I run it and got error: sort: invalid option -- 'V' As far as I can see there isn't option -V in sort help. What do you mean in sort -k2 -V "${txttempdir}/${txtfilename}"?
sorry, I wrote this script on Factory (coreutils v. 7.1) ... sort -V (version-sort) is a new feature introduced in coreutils v. 7.0. SUSE 11.1 is only on v. 6.12, so you are quite right it is missing that command ... I don't know if it is safe to upgrade coreutils or if a suitable replacement hack can be created. Regards, MasterPatricko -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Wednesday 05 August 2009 On Wednesday 05 August 2009 22:20:26 MasterPatricko wrote:
I wrote this script on Factory (coreutils v. 7.1) ... sort -V (version-sort) is a new feature introduced in coreutils v. 7.0. SUSE 11.1 is only on v. 6.12, so you are quite right it is missing that command ... I don't know if it is safe to upgrade coreutils or if a suitable replacement hack can be created.
No problem for me. I have 11.1 and Factory installed with common osc cache directory. So I can run the script on Factory. -- WBR, Kyrill Detinov -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
participants (2)
-
Kyrill Detinov
-
MasterPatricko