keeping garchivedir cruft-free



Since I use the same garchivedir for all of my garnome runs (so that
tarballs that don't change between garnome versions don't have to be gotten
again), I accumulate multiple tarballs of the same package (different
versions).  The following perl script (when fed as ./findolds.pl|sh) clears
the old versions out.  Perhaps something like this should be included in
future garnome releases?

-- 
  Ami Fischman
  usenet fischman org

===./findolds.pl======================================================
#!/usr/bin/perl

my $garchivedir="/home/fischman/t/gar/garchive";

my $basename, $prevname;
open(LS, "/bin/ls -r $garchivedir|") or die("Couldn't open ls");
while (<LS>) {
  chomp;
  if ($_ =~ /^(.*?)-[-\d\.]*\.tar\.[bg]z2?$/) {
    $basename=$1;
  } else {
    $basename=$_;
  }
  if ($basename eq $prevname) { print "rm $_\n"; }
  $prevname=$basename;
}
close(LS);
======================================================================




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]