How to purge old versions in equo cache? [Solved]

Anything that pertains to Entropy, Equo or Sulfur

Moderator: Moderators

How to purge old versions in equo cache? [Solved]

Postby nobicycle » Tue May 25, 2010 6:46

Hi,
Over time I have several versions of packages in the equo cache. I am looking for a command to purge all files there except the latest versions.
"equo cache clean " appears to do nothing.

Thanks to any respondent.
Last edited by nobicycle on Tue Sep 11, 2012 4:37, edited 1 time in total.
nobicycle
Simple Hen
 
Posts: 60
Joined: Fri Nov 20, 2009 13:55

Re: How to purge old versions in equo cache?

Postby joost » Tue May 25, 2010 8:17

equo cleanup simply removes all downloaded files.
The "cache clean" function is database related. Entropy caches searches and calculations. What you did was clean that data up.
User avatar
joost
Sagely Hen
 
Posts: 2313
Joined: Fri Nov 17, 2006 12:11
Location: The Netherlands

Re: How to purge old versions in equo cache?

Postby nobicycle » Wed Apr 25, 2012 15:06

I live in an area where internet is slow and unreliable. I would therefore like to purge the equo cache except for latest versions.

In this example of a file listing, the default sort on name would allow me to clear out the top two files:
qt-qt3support-4.8.0~0
qt-qt3support-4.8.1~0
qt-qt3support-4.8.1~1

However, once versions cross over a power of 10 boundary, the default sort wont work. Secondly I can't parse the version due to variable numbers of dots and minus signs in naming the packages.
Perhaps the equo API would help but I cannot find a full reference.
nobicycle
Simple Hen
 
Posts: 60
Joined: Fri Nov 20, 2009 13:55

Re: How to purge old versions in equo cache?

Postby nobicycle » Tue Sep 11, 2012 4:37

Ended up with a script that does:
for d in packages packages-nonfree packages-restricted; do
create_array_of_package_names
for package in array_of_package_names do
test if package is installed
if package installed
find the version of this package with the highest version
delete packages of lower version
nobicycle
Simple Hen
 
Posts: 60
Joined: Fri Nov 20, 2009 13:55

Re: How to purge old versions in equo cache? [Solved]

Postby lxnay » Tue Sep 11, 2012 6:30

Code: Select all
find "/var/lib/entropy/client/packages" -atime +30 -type f -delete

This will remove files with access time older than 30 days. However, your filesystem may be mounted with "noatime" and in that case, this wouldn't work as you expect. If this is the case, you could use "-mtime" (modification time), even though it's not the same as "atime".
Image
Join us on IRC (chat.freenode.net #sabayon or WebChat)
Submit bugs to our Bug Tracker
Follow me on Twitter
Add me on Facebook
Add me on Google+
lxnay
Land Owner
 
Posts: 3415
Joined: Thu Oct 13, 2005 23:16
Location: Italy


Return to Entropy|Equo|Rigo Package Managers

Who is online

Users browsing this forum: No registered users and 2 guests