Armisis Aieoln <[EMAIL PROTECTED]> writes:

> Hello again all, Just writing to see if anyone can suggest a utility for
> cleaning out old versions of my RPMS/files from my /Mandrake-devel/cooker
> directory... The more I upgrade the more old stuff gets left behind and I have
> to manualy get in there and root arround for stuff that is no longer needed or
> outdated.  I was hoping some one has already addressed this issue but If not I
> would love to try to make a script or something to do the job, but I dont know
> where to begin in writing such a tool.

by date :

#!/usr/bin/perl
@list = sort @ARGV;

foreach (@list) {
    ($name) = m|([^/]+)-[^-]+-[^-]+\.[^.]+\.rpm$|;
    if ($name eq $last) {
        if ((stat($_))[9] < (stat($lastfile))[9]) { print "$_ "; next; }
        if ((stat($_))[9] > (stat($lastfile))[9]) { print "$lastfile "; }
    } 
    $last = $name;
    $lastfile = $_;
}
print "\n";


-- 
MandrakeSoft Inc                http://www.mandrakesoft.com
San Diego, CA USA                                  --Chmouel

Reply via email to