| version 1.35, 2010/03/08 20:19:35 |
version 1.38, 2010/03/22 21:36:28 |
|
|
| #!/usr/bin/perl -T |
#!/usr/bin/perl -T |
| #$RedRiver: CurrentTorrents.pl,v 1.34 2010/03/03 18:31:57 andrew Exp $ |
#$RedRiver: CurrentTorrents.pl,v 1.37 2010/03/16 22:40:18 andrew Exp $ |
| use strict; |
use strict; |
| use warnings; |
use warnings; |
| use diagnostics; |
use diagnostics; |
|
|
| $name = $base; |
$name = $base; |
| } |
} |
| |
|
| #print "Adding $_\n"; |
#print "Adding $DIR/$_\n"; |
| |
|
| $files{$ext}{$name}{$epoch} = { |
my $ct = { |
| file => $_, |
file => $_, |
| dir => $DIR, |
dir => $DIR, |
| #path => "$DIR/$_", |
#path => "$DIR/$_", |
|
|
| if ( $name =~ m/\A $OBT->{BASENAME} /xms |
if ( $name =~ m/\A $OBT->{BASENAME} /xms |
| && !exists $Possible_Torrents{$name} ) |
&& !exists $Possible_Torrents{$name} ) |
| { |
{ |
| #print "Would remove $_\n"; |
print "Would remove impossible $_\n"; |
| push @delete, $files{$ext}{$name}{$epoch}; |
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; |
closedir DIR; |
| } |
} |
|
|
| or die "Couldn't rename '$file': $!"; |
or die "Couldn't rename '$file': $!"; |
| |
|
| $dir = $OBT->{DIR_TORRENT}; |
$dir = $OBT->{DIR_TORRENT}; |
| $keep{$hash}{dir} = $dir; |
$keep{$hash}{dir} = $dir; |
| |
|
| if ( exists $files{txt}{$name}{$epoch} ) { |
if ( exists $files{txt}{$name}{$epoch} ) { |
| my $m_file = $files{txt}{$name}{$epoch}{file}; |
my $m_file = $files{txt}{$name}{$epoch}{file}; |
|
|
| foreach my $file (@$files) { |
foreach my $file (@$files) { |
| if ( $file =~ /$INSTALL_ISO_REGEX/ ) { |
if ( $file =~ /$INSTALL_ISO_REGEX/ ) { |
| Make_Possible("$dir/$file"); |
Make_Possible("$dir/$file"); |
| |
} |
| |
elsif ( $file =~ /$SONG_REGEX/xms ) { |
| |
Make_Possible("$dir/$1"); |
| } |
} |
| } |
} |
| } |
} |