=================================================================== RCS file: /cvs/openbsd/OpenBSDTorrents/MakeTorrents.pl,v retrieving revision 1.12 retrieving revision 1.16 diff -u -r1.12 -r1.16 --- openbsd/OpenBSDTorrents/MakeTorrents.pl 2005/05/02 22:49:54 1.12 +++ openbsd/OpenBSDTorrents/MakeTorrents.pl 2005/05/06 21:07:22 1.16 @@ -1,11 +1,11 @@ #!/usr/bin/perl -T -#$Id: MakeTorrents.pl,v 1.12 2005/05/02 21:49:54 andrew Exp $ +#$Id: MakeTorrents.pl,v 1.16 2005/05/06 20:07:22 andrew Exp $ use strict; use warnings; use diagnostics; use lib 'lib'; -use BT::OBTMetaInfo; +use BT::MetaInfo::Cached; use OpenBSDTorrents; %ENV = (); @@ -29,7 +29,7 @@ { my $basedir = shift; - return undef if $basedir =~ /packages/; + #return undef if $basedir =~ /packages/; my ($dirs, $files) = Get_Files_and_Dirs($basedir); if (@$files) { @@ -110,7 +110,13 @@ my $torrent_with_path = $OBT->{DIR_NEW_TORRENT} . "/$torrent"; - my $t = BT::OBTMetaInfo->new(); + my $t = BT::MetaInfo::Cached->new( + { + cache_root => + $OBT->{DIR_HOME} . '/FileCache' + } + ); + $t->name($name); $t->announce($announce); unless ($announce =~ m!^http://[^/]+/!i) { @@ -132,7 +138,7 @@ return 0; } - my $hash = $t->info_hash_cached($torrent_with_path); + my $hash = $t->info_hash; $hash = unpack("H*", $hash); $t->save($torrent_with_path);