=================================================================== RCS file: /cvs/openbsd/OpenBSDTorrents/CurrentTorrents.pl,v retrieving revision 1.36 retrieving revision 1.38 diff -u -r1.36 -r1.38 --- openbsd/OpenBSDTorrents/CurrentTorrents.pl 2010/03/16 23:37:32 1.36 +++ openbsd/OpenBSDTorrents/CurrentTorrents.pl 2010/03/22 21:36:28 1.38 @@ -1,5 +1,5 @@ #!/usr/bin/perl -T -#$RedRiver: CurrentTorrents.pl,v 1.35 2010/03/08 20:19:35 andrew Exp $ +#$RedRiver: CurrentTorrents.pl,v 1.37 2010/03/16 22:40:18 andrew Exp $ use strict; use warnings; use diagnostics; @@ -60,11 +60,7 @@ #print "Adding $DIR/$_\n"; - if (exists $files{$ext}{$name}{$epoch}) { - warn "Multiple torrents with $name and epoch $epoch\n"; - } - - $files{$ext}{$name}{$epoch} = { + my $ct = { file => $_, dir => $DIR, #path => "$DIR/$_", @@ -82,9 +78,18 @@ if ( $name =~ m/\A $OBT->{BASENAME} /xms && !exists $Possible_Torrents{$name} ) { - #print "Would remove $_\n"; - push @delete, $files{$ext}{$name}{$epoch}; + print "Would remove impossible $_\n"; + push @delete, $ct; + } + else { + if ($files{$ext}{$name}{$epoch}) { + warn "Multiple torrents with $name and epoch $epoch\n"; + push @delete, $files{$ext}{$name}{$epoch}; + } + + $files{$ext}{$name}{$epoch} = $ct; } + } closedir DIR; } @@ -211,7 +216,7 @@ or die "Couldn't rename '$file': $!"; $dir = $OBT->{DIR_TORRENT}; - $keep{$hash}{dir} = $dir; + $keep{$hash}{dir} = $dir; if ( exists $files{txt}{$name}{$epoch} ) { my $m_file = $files{txt}{$name}{$epoch}{file}; @@ -277,6 +282,9 @@ foreach my $file (@$files) { if ( $file =~ /$INSTALL_ISO_REGEX/ ) { Make_Possible("$dir/$file"); + } + elsif ( $file =~ /$SONG_REGEX/xms ) { + Make_Possible("$dir/$1"); } } }