=================================================================== RCS file: /cvs/openbsd/OpenBSDTorrents/CurrentTorrents.pl,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- openbsd/OpenBSDTorrents/CurrentTorrents.pl 2005/04/07 00:04:40 1.11 +++ openbsd/OpenBSDTorrents/CurrentTorrents.pl 2005/05/02 21:27:00 1.12 @@ -1,5 +1,5 @@ #!/usr/bin/perl -T -#$Id: CurrentTorrents.pl,v 1.11 2005/04/06 23:04:40 andrew Exp $ +#$Id: CurrentTorrents.pl,v 1.12 2005/05/02 20:27:00 andrew Exp $ use strict; use warnings; use diagnostics; @@ -16,6 +16,13 @@ justme(); +my $Name_Filter = shift || ''; +if ($Name_Filter =~ /^(\w*)$/) { + $Name_Filter = $1; +} else { + die "Invalid filter: $Name_Filter"; +} + my %files; opendir DIR, $OBT->{DIR_TORRENT} or die "Couldn't opendir $OBT->{DIR_TORRENT}: $!"; @@ -50,7 +57,8 @@ my %keep; my @delete; foreach my $name (keys %files) { - #print "$name\n"; + next unless $name =~ /^$Name_Filter/; + print "Checking $name\n"; foreach my $epoch ( sort { $b <=> $a } keys %{ $files{$name} } ) { #print "\t$epoch\n";