=================================================================== RCS file: /cvs/openbsd/OpenBSDTorrents/CurrentTorrents.pl,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- openbsd/OpenBSDTorrents/CurrentTorrents.pl 2005/04/06 23:28:05 1.9 +++ openbsd/OpenBSDTorrents/CurrentTorrents.pl 2005/04/06 23:40:20 1.10 @@ -1,5 +1,5 @@ #!/usr/bin/perl -T -#$Id: CurrentTorrents.pl,v 1.9 2005/04/06 22:28:05 andrew Exp $ +#$Id: CurrentTorrents.pl,v 1.10 2005/04/06 22:40:20 andrew Exp $ use strict; use warnings; use diagnostics; @@ -17,7 +17,8 @@ justme(); my %files; -opendir DIR, $TorrentDir or die "Couldn't opendir $TorrentDir: $!"; +opendir DIR, $OBT->{DIR_TORRENT} + or die "Couldn't opendir $OBT->{DIR_TORRENT}: $!"; foreach (readdir DIR) { if (/^([^\/]+)$/) { $_ = $1; @@ -56,7 +57,7 @@ my $torrent = $files{$name}{$epoch}{file}; my $t; - eval { $t = BT::MetaInfo->new("$TorrentDir/$torrent"); }; + eval { $t = BT::MetaInfo->new($OBT->{DIR_TORRENT} . "/$torrent"); }; if ($@) { warn "Error reading torrent $torrent\n"; next; @@ -65,7 +66,7 @@ $files{$name}{$epoch}{comment} = $t->{comment}; my ($path) = $t->{comment} =~ /Files from ([^\n]+)\n/s; - unless (-d "$BaseDir/$path") { + unless (-d $OBT->{DIR_FTP} . "/$path") { #print "Deleting $files{$name}{$epoch}{file} the path doesn't exist.\n"; push @delete, $files{$name}{$epoch}{file}; } @@ -102,5 +103,5 @@ foreach (@delete) { print "Deleting '$_'\n"; - unlink "$TorrentDir/$_" or die "Couldn't unlink $_"; + unlink $OBT->{TORRENTDIR} . "/$_" or die "Couldn't unlink $_"; }