=================================================================== RCS file: /cvs/openbsd/OpenBSDTorrents/MakeTorrents.pl,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- openbsd/OpenBSDTorrents/MakeTorrents.pl 2005/03/24 00:21:43 1.7 +++ openbsd/OpenBSDTorrents/MakeTorrents.pl 2005/03/24 19:49:09 1.8 @@ -1,5 +1,5 @@ #!/usr/bin/perl -T -#$Id: MakeTorrents.pl,v 1.7 2005/03/24 00:21:43 andrew Exp $ +#$Id: MakeTorrents.pl,v 1.8 2005/03/24 19:49:09 andrew Exp $ use strict; use warnings; use diagnostics; @@ -14,7 +14,9 @@ use YAML; my $Piece_Length = 18; + my $MinFiles = 5; +my $MinSize = 50 * 1024 * 1024; # 50 MiB my $StartDir = shift || $BaseName; $StartDir =~ s#/$##; @@ -122,6 +124,12 @@ $t->creation_date(time); warn "Checksumming files. This may take a little while...\n"; $t->set_files(@$files); + + if ($t->total_size < $MinSize) { + print "Skipping smaller than minimum size\n"; + return 0; + } + $t->save("$torrent"); print "Created: $torrent\n"; #system("btinfo $torrent") if ($::opt_I);