diff -Nru libbencode-perl-1.4/Changes libbencode-perl-1.402/Changes --- libbencode-perl-1.4/Changes 2010-07-06 17:59:15.000000000 +0000 +++ libbencode-perl-1.402/Changes 2015-01-10 10:30:34.000000000 +0000 @@ -1,69 +1,33 @@ -=head1 Revision history for Bencode +Revision history for Bencode +1.402 Sat 10 Jan 2015 + - No functional changes + - No longer contains INSTALL file with install-as-root instructions + +1.401 Sun 4 Jan 2015 + - Now uses Exporter::Tidy + - Minimum Perl back to 5.6 + +1.4 Tue 6 Jul 2010 + - New $max_depth parameter to limit structure depth in parsing; fixes RT #59131 + Many thanks to Day Barr for the report and the patch! + +1.31 Mon 5 Nov 2007 + - `use vars` is necessary to get rid of `our` + +1.3 Mon 5 Nov 2007 + - Got rid of `our`; should work as far back as Perl 5.4 now + +1.2 Sun 4 Nov 2007 + - Test for newline-resilient string parsing (RT #30466) + +1.1 Sun 4 Nov 2007 + - Changed parsing of strings to not break on newlines (RT #30466) + - Added leniency option to bdecode() (RT #19665) + - Greatly improved error reporting (RT #30466) + - Fixed test suite to check for correct error message when rejecting input + - Switched to inheritance-based use of Exporter + (previously imported import(); not available on older Perls) -=head2 1.4 (2010-07-06 19:46:03+0200) - -=over 4 - -=item * New C<$max_depth> parameter to limit structure depth in parsing; fixes RT #59131 - -Many thanks to Day Barr for the report and the patch! - -=back - - -=head2 1.31 (2007-11-05 02:53:06+01:00) - -=over 4 - -=item * C is necessary to get rid of C. Why doesn't C<./Build distcheck> run tests? - -=back - - -=head2 1.3 (2007-11-05 00:08:04+01:00) - -=over 4 - -=item * Get rid of C; should work as far back as Perl 5.4 now - -=back - - -=head2 1.2 (2007-11-04 19:37:37+01:00) - -=over 4 - -=item * 1.1 was released without changes in Changelog; fill in changes - -=item * Switch to POD changelog - -=item * Add test for newline-resilient string parsing (RT #30466) - -=back - - -=head2 1.1 (2007-11-04 19:14:24+01:00) - -=over 4 - -=item * Change parsing of strings to not break on newlines (RT #30466) - -=item * Add leniency option to C (RT #19665) - -=item * Greatly improved error reporting (RT #30466) - -=item * Fix test suite to check for correct error message when rejecting input - -=item * Switch to inheritance-based use of L (previously imported C; not available on older Perls) - -=back - - -=head2 1.0 (2006-04-15 11:54:39+01:00) - -=over 4 - -=item * Initial release. - -=back +1.0 Sat 15 Apr 2006 + - Initial release. diff -Nru libbencode-perl-1.4/debian/changelog libbencode-perl-1.402/debian/changelog --- libbencode-perl-1.4/debian/changelog 2011-06-17 14:11:17.000000000 +0000 +++ libbencode-perl-1.402/debian/changelog 2015-08-12 12:45:57.000000000 +0000 @@ -1,3 +1,33 @@ +libbencode-perl (1.402-1) unstable; urgency=low + + * Team upload. + + [ Salvatore Bonaccorso ] + * debian/copyright: Replace DEP5 Format-Specification URL from + svn.debian.org to anonscm.debian.org URL. + * Change search.cpan.org based URIs to metacpan.org based URIs + + [ Axel Beckert ] + * debian/copyright: migrate pre-1.0 format to 1.0 using "cme fix dpkg- + copyright" + + [ gregor herrmann ] + * Strip trailing slash from metacpan URLs. + + [ Salvatore Bonaccorso ] + * Update Vcs-Browser URL to cgit web frontend + + [ Lucas Kanashiro ] + * Add debian/upstream/metadata + * Import upstream version 1.402 + * Set debhelper >= 9 + * Declare compliance with Debian policy 3.9.6 + * Add autopkgtest-pkg-perl + * Update build and runtime dependencies + * Update year of upstream copyright + + -- Lucas Kanashiro Wed, 12 Aug 2015 09:13:26 -0300 + libbencode-perl (1.4-1) unstable; urgency=low * Initial Release. (Closes: #630653) diff -Nru libbencode-perl-1.4/debian/compat libbencode-perl-1.402/debian/compat --- libbencode-perl-1.4/debian/compat 2011-06-17 14:11:17.000000000 +0000 +++ libbencode-perl-1.402/debian/compat 2015-08-12 12:45:57.000000000 +0000 @@ -1 +1 @@ -8 +9 diff -Nru libbencode-perl-1.4/debian/control libbencode-perl-1.402/debian/control --- libbencode-perl-1.4/debian/control 2011-06-17 14:11:17.000000000 +0000 +++ libbencode-perl-1.402/debian/control 2015-08-12 12:45:57.000000000 +0000 @@ -1,18 +1,28 @@ Source: libbencode-perl -Section: perl -Priority: optional -Build-Depends: debhelper (>= 8) -Build-Depends-Indep: perl Maintainer: Debian Perl Group Uploaders: Fabrizio Regalli -Standards-Version: 3.9.2 -Homepage: http://search.cpan.org/dist/Bencode/ +Section: perl +Testsuite: autopkgtest-pkg-perl +Priority: optional +Build-Depends: debhelper (>= 9) +Build-Depends-Indep: perl, + libb-hooks-op-check-perl (>= 0.18), + libextutils-depends-perl (>= 0.302), + libb-hooks-endofscope-perl, + libexporter-tidy-perl, + libtest-differences-perl, + libtest-exception-perl +Standards-Version: 3.9.6 +Vcs-Browser: https://anonscm.debian.org/cgit/pkg-perl/packages/libbencode-perl.git Vcs-Git: git://anonscm.debian.org/pkg-perl/packages/libbencode-perl.git -Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-perl/packages/libbencode-perl.git +Homepage: https://metacpan.org/release/Bencode Package: libbencode-perl Architecture: all -Depends: ${misc:Depends}, ${perl:Depends} +Depends: ${misc:Depends}, + ${perl:Depends}, + libb-hooks-op-check-perl, + libexporter-tidy-perl Description: Perl module for BitTorrent serialisation format Bencode implements the BitTorrent bencode serialisation format as described in http://www.bittorrent.org/beps/bep_0003.html diff -Nru libbencode-perl-1.4/debian/copyright libbencode-perl-1.402/debian/copyright --- libbencode-perl-1.4/debian/copyright 2011-06-17 14:11:17.000000000 +0000 +++ libbencode-perl-1.402/debian/copyright 2015-08-12 12:45:57.000000000 +0000 @@ -1,14 +1,15 @@ -Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135 -Maintainer: Aristotle Pagaltzis -Source: http://search.cpan.org/dist/Bencode/ -Name: Bencode +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: Bencode +Upstream-Contact: Aristotle Pagaltzis +Source: https://metacpan.org/release/Bencode Files: * -Copyright: 2010, Aristotle Pagaltzis +Copyright: 2015, Aristotle Pagaltzis License: Artistic or GPL-1+ Files: debian/* Copyright: 2011, Fabrizio Regalli + 2015, Lucas Kanashiro License: Artistic or GPL-1+ License: Artistic diff -Nru libbencode-perl-1.4/debian/upstream/metadata libbencode-perl-1.402/debian/upstream/metadata --- libbencode-perl-1.4/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 +++ libbencode-perl-1.402/debian/upstream/metadata 2015-08-12 12:45:57.000000000 +0000 @@ -0,0 +1,6 @@ +--- +Archive: CPAN +Bug-Database: http://github.com/ap/Bencode/issues +Contact: Aristotle Pagaltzis +Name: Bencode +Repository: git://github.com/ap/Bencode diff -Nru libbencode-perl-1.4/debian/watch libbencode-perl-1.402/debian/watch --- libbencode-perl-1.4/debian/watch 2011-06-17 14:11:17.000000000 +0000 +++ libbencode-perl-1.402/debian/watch 2015-08-12 12:45:57.000000000 +0000 @@ -1,2 +1,2 @@ version=3 -http://search.cpan.org/dist/Bencode/ .*/Bencode-v?(\d[\d.-]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)$ +https://metacpan.org/release/Bencode .*/Bencode-v?(\d[\d.-]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)$ diff -Nru libbencode-perl-1.4/dist.ini libbencode-perl-1.402/dist.ini --- libbencode-perl-1.4/dist.ini 2010-07-06 17:59:15.000000000 +0000 +++ libbencode-perl-1.402/dist.ini 2015-01-10 10:30:34.000000000 +0000 @@ -1,19 +1,24 @@ name = Bencode -version = 1.4 +version = 1.402 author = Aristotle Pagaltzis license = Perl_5 copyright_holder = Aristotle Pagaltzis +copyright_year = 2015 [MetaResources] homepage = http://github.com/ap/Bencode bugtracker = http://github.com/ap/Bencode/issues repository = git://github.com/ap/Bencode -[@Basic] +[@Filter] +-bundle=@Basic +-remove=Readme +[Readme::Brief] +[ReadmeAnyFromPod / PodInRoot] [MetaJSON] [PkgVersion] [PodWeaver] [CheckChangeLog] - -[Prereqs / TestRequires] -Test::More = 0 +[Test::Compile] +[AutoPrereqs] +[CheckSelfDependency] diff -Nru libbencode-perl-1.4/lib/Bencode.pm libbencode-perl-1.402/lib/Bencode.pm --- libbencode-perl-1.4/lib/Bencode.pm 2010-07-06 17:59:15.000000000 +0000 +++ libbencode-perl-1.402/lib/Bencode.pm 2015-01-10 10:30:34.000000000 +0000 @@ -1,17 +1,15 @@ -package Bencode; -BEGIN { - $Bencode::VERSION = '1.4'; -} +use 5.006; use strict; -use Carp; -use Exporter; +use warnings; +package Bencode; +$Bencode::VERSION = '1.402'; # ABSTRACT: BitTorrent serialisation format -use vars qw( $VERSION @ISA @EXPORT_OK $DEBUG $do_lenient_decode $max_depth ); +use Carp; +use Exporter::Tidy all => [qw( bencode bdecode )]; -@ISA = qw( Exporter ); -@EXPORT_OK = qw( bencode bdecode ); +our ( $DEBUG, $do_lenient_decode, $max_depth ); sub _msg { sprintf "@_", pos() || 0 } @@ -144,17 +142,19 @@ bdecode( 'i1e' ); - +__END__ =pod +=encoding UTF-8 + =head1 NAME Bencode - BitTorrent serialisation format =head1 VERSION -version 1.4 +version 1.402 =head1 SYNOPSIS @@ -166,13 +166,18 @@ =head1 DESCRIPTION -This module implements the BitTorrent I serialisation format as described in L. +This module implements the BitTorrent I serialisation format, +as described in L. -=head1 INTERFACE +=head1 INTERFACE =head2 C -Takes a single argument which may be a scalar or a reference to a scalar, array or hash. Arrays and hashes may in turn contain values of these same types. Simple scalars that look like canonically represented integers will be serialised as such. To bypass the heuristic and force serialisation as a string, use a reference to a scalar. +Takes a single argument which may be a scalar, or may be a reference to either +a scalar, an array or a hash. Arrays and hashes may in turn contain values of +these same types. Plain scalars that look like canonically represented integers +will be serialised as such. To bypass the heuristic and force serialisation as +a string, use a reference to a scalar. Croaks on unhandled data types. @@ -180,9 +185,12 @@ Takes a string and returns the corresponding deserialised data structure. -If you pass a true value for the second option, it will disregard the sort order of dict keys. This violation of the I format is somewhat common. +If you pass a true value for the second option, it will disregard the sort +order of dict keys. This violation of the I format is somewhat common. -If you pass an integer for the third option, it will croak when attempting to parse dictionaries nested deeper than this level, to prevent DoS attacks using maliciously crafted input. +If you pass an integer for the third option, it will croak when attempting to +parse dictionaries nested deeper than this level, to prevent DoS attacks using +maliciously crafted input. Croaks on malformed data. @@ -210,23 +218,28 @@ =item C -Your data contained a string with negative length or a length with leading zeroes. +Your data contained a string with negative length or a length with leading +zeroes. =item C -Your data contained something that was supposed to be an integer but didn't make sense. +Your data contained something that was supposed to be an integer but didn't +make sense. =item C -Your data violates the I format constaint that dict keys must appear in lexical sort order. +Your data violates the I format constaint that dict keys must appear +in lexical sort order. =item C -Your data violates the I format constaint that all dict keys must be unique. +Your data violates the I format constaint that all dict keys must be +unique. =item C -Your data violates the I format constaint that all dict keys be strings. +Your data violates the I format constaint that all dict keys be +strings. =item C @@ -234,21 +247,31 @@ =item C -Your data contains dicts or lists that are nested deeper than the $max_depth passed to C. +Your data contains dicts or lists that are nested deeper than the $max_depth +passed to C. =item C -You are trying to serialise a data structure that consists of data types other than +You are trying to serialise a data structure that consists of data types other +than =over -=item * scalars +=item * + +scalars -=item * references to arrays +=item * -=item * references to hashes +references to arrays -=item * references to scalars +=item * + +references to hashes + +=item * + +references to scalars =back @@ -258,23 +281,19 @@ =head1 BUGS AND LIMITATIONS -Strings and numbers are practically indistinguishable in Perl, so C has to resort to a heuristic to decide how to serialise a scalar. This cannot be fixed. - -Please report any bugs or feature requests through the web interface at L. +Strings and numbers are practically indistinguishable in Perl, so C +has to resort to a heuristic to decide how to serialise a scalar. This cannot +be fixed. =head1 AUTHOR - Aristotle Pagaltzis +Aristotle Pagaltzis =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2010 by Aristotle Pagaltzis. +This software is copyright (c) 2015 by Aristotle Pagaltzis. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut - - -__END__ - diff -Nru libbencode-perl-1.4/LICENSE libbencode-perl-1.402/LICENSE --- libbencode-perl-1.4/LICENSE 2010-07-06 17:59:15.000000000 +0000 +++ libbencode-perl-1.402/LICENSE 2015-01-10 10:30:34.000000000 +0000 @@ -1,4 +1,4 @@ -This software is copyright (c) 2010 by Aristotle Pagaltzis. +This software is copyright (c) 2015 by Aristotle Pagaltzis. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. @@ -12,21 +12,22 @@ --- The GNU General Public License, Version 1, February 1989 --- -This software is Copyright (c) 2010 by Aristotle Pagaltzis. +This software is Copyright (c) 2015 by Aristotle Pagaltzis. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 - GNU GENERAL PUBLIC LICENSE - Version 1, February 1989 + GNU GENERAL PUBLIC LICENSE + Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + 51 Franklin St, Suite 500, Boston, MA 02110-1335 USA + Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - Preamble + Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public @@ -67,7 +68,7 @@ The precise terms and conditions for copying, distribution and modification follow. - GNU GENERAL PUBLIC LICENSE + GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which @@ -185,7 +186,7 @@ of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - NO WARRANTY + NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN @@ -207,9 +208,9 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - END OF TERMS AND CONDITIONS + END OF TERMS AND CONDITIONS - Appendix: How to Apply These Terms to Your New Programs + Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it @@ -235,8 +236,9 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA + Also add information on how to contact you by electronic and paper mail. @@ -270,7 +272,7 @@ --- The Artistic License 1.0 --- -This software is Copyright (c) 2010 by Aristotle Pagaltzis. +This software is Copyright (c) 2015 by Aristotle Pagaltzis. This is free software, licensed under: diff -Nru libbencode-perl-1.4/Makefile.PL libbencode-perl-1.402/Makefile.PL --- libbencode-perl-1.4/Makefile.PL 2010-07-06 17:59:15.000000000 +0000 +++ libbencode-perl-1.402/Makefile.PL 2015-01-10 10:30:34.000000000 +0000 @@ -1,45 +1,61 @@ +# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.030. use strict; use warnings; +use 5.006; - -use ExtUtils::MakeMaker 6.31; +use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( - 'ABSTRACT' => 'BitTorrent serialisation format', - 'AUTHOR' => 'Aristotle Pagaltzis ', - 'BUILD_REQUIRES' => { - 'Test::More' => '0' + "ABSTRACT" => "BitTorrent serialisation format", + "AUTHOR" => "Aristotle Pagaltzis ", + "CONFIGURE_REQUIRES" => { + "ExtUtils::MakeMaker" => 0 + }, + "DISTNAME" => "Bencode", + "EXE_FILES" => [], + "LICENSE" => "perl", + "MIN_PERL_VERSION" => "5.006", + "NAME" => "Bencode", + "PREREQ_PM" => { + "Carp" => 0, + "Exporter::Tidy" => 0, + "strict" => 0, + "warnings" => 0 }, - 'CONFIGURE_REQUIRES' => { - 'ExtUtils::MakeMaker' => '6.31' + "TEST_REQUIRES" => { + "File::Find" => 0, + "File::Temp" => 0, + "Test::Differences" => 0, + "Test::More" => "0.88" }, - 'DISTNAME' => 'Bencode', - 'EXE_FILES' => [], - 'LICENSE' => 'perl', - 'NAME' => 'Bencode', - 'PREREQ_PM' => {}, - 'VERSION' => '1.4', - 'test' => { - 'TESTS' => 't/*.t' + "VERSION" => "1.402", + "test" => { + "TESTS" => "t/*.t" } ); -unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) { - my $br = delete $WriteMakefileArgs{BUILD_REQUIRES}; - my $pp = $WriteMakefileArgs{PREREQ_PM}; - for my $mod ( keys %$br ) { - if ( exists $pp->{$mod} ) { - $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod}; - } - else { - $pp->{$mod} = $br->{$mod}; - } - } +my %FallbackPrereqs = ( + "Carp" => 0, + "Exporter::Tidy" => 0, + "ExtUtils::MakeMaker" => 0, + "File::Find" => 0, + "File::Temp" => 0, + "Test::Differences" => 0, + "Test::More" => "0.88", + "strict" => 0, + "warnings" => 0 +); + + +unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { + delete $WriteMakefileArgs{TEST_REQUIRES}; + delete $WriteMakefileArgs{BUILD_REQUIRES}; + $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} diff -Nru libbencode-perl-1.4/MANIFEST libbencode-perl-1.402/MANIFEST --- libbencode-perl-1.4/MANIFEST 2010-07-06 17:59:15.000000000 +0000 +++ libbencode-perl-1.402/MANIFEST 2015-01-10 10:30:34.000000000 +0000 @@ -1,3 +1,4 @@ +# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.030. Changes LICENSE MANIFEST @@ -7,7 +8,6 @@ README dist.ini lib/Bencode.pm -t/00.load.t -t/01.bdecode.t -t/02.bencode.t -t/cpants.t +t/00-compile.t +t/01-bdecode.t +t/02-bencode.t diff -Nru libbencode-perl-1.4/META.json libbencode-perl-1.402/META.json --- libbencode-perl-1.4/META.json 2010-07-06 17:59:15.000000000 +0000 +++ libbencode-perl-1.402/META.json 2015-01-10 10:30:34.000000000 +0000 @@ -4,7 +4,7 @@ "Aristotle Pagaltzis " ], "dynamic_config" : 0, - "generated_by" : "Dist::Zilla version 4.101831, CPAN::Meta::Converter version 2.101670", + "generated_by" : "Dist::Zilla version 5.030, CPAN::Meta::Converter version 2.143240", "license" : [ "perl_5" ], @@ -16,12 +16,24 @@ "prereqs" : { "configure" : { "requires" : { - "ExtUtils::MakeMaker" : "6.31" + "ExtUtils::MakeMaker" : "0" + } + }, + "runtime" : { + "requires" : { + "Carp" : "0", + "Exporter::Tidy" : "0", + "perl" : "5.006", + "strict" : "0", + "warnings" : "0" } }, "test" : { "requires" : { - "Test::More" : 0 + "File::Find" : "0", + "File::Temp" : "0", + "Test::Differences" : "0", + "Test::More" : "0.88" } } }, @@ -36,5 +48,6 @@ "url" : "git://github.com/ap/Bencode" } }, - "version" : "1.4" + "version" : "1.402" } + diff -Nru libbencode-perl-1.4/META.yml libbencode-perl-1.402/META.yml --- libbencode-perl-1.4/META.yml 2010-07-06 17:59:15.000000000 +0000 +++ libbencode-perl-1.402/META.yml 2015-01-10 10:30:34.000000000 +0000 @@ -3,18 +3,27 @@ author: - 'Aristotle Pagaltzis ' build_requires: - Test::More: 0 + File::Find: 0 + File::Temp: 0 + Test::Differences: 0 + Test::More: 0.88 configure_requires: - ExtUtils::MakeMaker: 6.31 + ExtUtils::MakeMaker: 0 dynamic_config: 0 -generated_by: 'Dist::Zilla version 4.101831, CPAN::Meta::Converter version 2.101670' +generated_by: 'Dist::Zilla version 5.030, CPAN::Meta::Converter version 2.143240' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Bencode +requires: + Carp: 0 + Exporter::Tidy: 0 + perl: 5.006 + strict: 0 + warnings: 0 resources: bugtracker: http://github.com/ap/Bencode/issues homepage: http://github.com/ap/Bencode repository: git://github.com/ap/Bencode -version: 1.4 +version: 1.402 diff -Nru libbencode-perl-1.4/README libbencode-perl-1.402/README --- libbencode-perl-1.4/README 2010-07-06 17:59:15.000000000 +0000 +++ libbencode-perl-1.402/README 2015-01-10 10:30:34.000000000 +0000 @@ -1,13 +1,28 @@ +Bencode +This module implements the BitTorrent *bencode* serialisation format, as +described in . -This archive contains the distribution Bencode, -version 1.4: +INSTALLATION - BitTorrent serialisation format +This is a Perl module distribution. It should be installed with whichever +tool you use to manage your installation of Perl, e.g. any of -This software is copyright (c) 2010 by Aristotle Pagaltzis. + cpanm . + cpan . + cpanp -i . -This is free software; you can redistribute it and/or modify it under -the same terms as the Perl 5 programming language system itself. +Consult http://www.cpan.org/modules/INSTALL.html for further instruction. +Should you wish to install this module manually, the procedure is + + perl Makefile.PL + make + make test + make install +COPYRIGHT AND LICENSE +This software is copyright (c) 2015 by Aristotle Pagaltzis. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. diff -Nru libbencode-perl-1.4/t/00-compile.t libbencode-perl-1.402/t/00-compile.t --- libbencode-perl-1.4/t/00-compile.t 1970-01-01 00:00:00.000000000 +0000 +++ libbencode-perl-1.402/t/00-compile.t 2015-01-10 10:30:34.000000000 +0000 @@ -0,0 +1,73 @@ +#!perl + +use strict; +use warnings; + +use Test::More; + + + +use File::Find; +use File::Temp qw{ tempdir }; + +my @modules; +find( + sub { + return if $File::Find::name !~ /\.pm\z/; + my $found = $File::Find::name; + $found =~ s{^lib/}{}; + $found =~ s{[/\\]}{::}g; + $found =~ s/\.pm$//; + # nothing to skip + push @modules, $found; + }, + 'lib', +); + +sub _find_scripts { + my $dir = shift @_; + + my @found_scripts = (); + find( + sub { + return unless -f; + my $found = $File::Find::name; + # nothing to skip + open my $FH, '<', $_ or do { + note( "Unable to open $found in ( $! ), skipping" ); + return; + }; + my $shebang = <$FH>; + return unless $shebang =~ /^#!.*?\bperl\b\s*$/; + push @found_scripts, $found; + }, + $dir, + ); + + return @found_scripts; +} + +my @scripts; +do { push @scripts, _find_scripts($_) if -d $_ } + for qw{ bin script scripts }; + +my $plan = scalar(@modules) + scalar(@scripts); +$plan ? (plan tests => $plan) : (plan skip_all => "no tests to run"); + +{ + # fake home for cpan-testers + # no fake requested ## local $ENV{HOME} = tempdir( CLEANUP => 1 ); + + like( qx{ $^X -Ilib -e "require $_; print '$_ ok'" }, qr/^\s*$_ ok/s, "$_ loaded ok" ) + for sort @modules; + + SKIP: { + eval "use Test::Script 1.05; 1;"; + skip "Test::Script needed to test script compilation", scalar(@scripts) if $@; + foreach my $file ( @scripts ) { + my $script = $file; + $script =~ s!.*/!!; + script_compiles( $file, "$script script compiles" ); + } + } +} diff -Nru libbencode-perl-1.4/t/00.load.t libbencode-perl-1.402/t/00.load.t --- libbencode-perl-1.4/t/00.load.t 2010-07-06 17:59:15.000000000 +0000 +++ libbencode-perl-1.402/t/00.load.t 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -use Test::More tests => 1; - -BEGIN { - use_ok( 'Bencode' ) - or BAIL_OUT( 'testing pointless if the module won\'t even load' ); -} diff -Nru libbencode-perl-1.4/t/01-bdecode.t libbencode-perl-1.402/t/01-bdecode.t --- libbencode-perl-1.4/t/01-bdecode.t 1970-01-01 00:00:00.000000000 +0000 +++ libbencode-perl-1.402/t/01-bdecode.t 2015-01-10 10:30:34.000000000 +0000 @@ -0,0 +1,100 @@ +use strict; +use warnings; + +use Test::More 0.88; # for done_testing +use Test::Differences; +use Bencode 'bdecode'; + +sub un { + my ( $frozen ) = @_; + local $, = ', '; + return 'ARRAY' eq ref $frozen + ? ( "decode [@$frozen]", bdecode @$frozen ) + : ( "decode '$frozen'", bdecode $frozen ); +} + +sub decod_ok { + my ( $frozen, $thawed ) = @_; + my ( $testname, $result ) = un $frozen; + local $Test::Builder::Level = $Test::Builder::Level + 1; + eq_or_diff $result, $thawed, $testname; +} + +sub error_ok { + my ( $frozen, $error_rx, $kind_of_brokenness ) = @_; + local $@; + eval { un $frozen }; + local $Test::Builder::Level = $Test::Builder::Level + 1; + like $@, $error_rx, "reject $kind_of_brokenness"; +} + +error_ok '0:0:' => qr/\Atrailing garbage at 2\b/, 'data past end of first correct bencoded string'; +error_ok 'i' => qr/\Aunexpected end of data at 1\b/, 'aborted integer'; +error_ok 'i0' => qr/\Amalformed integer data at 1\b/, 'unterminated integer'; +error_ok 'ie' => qr/\Amalformed integer data at 1\b/, 'empty integer'; +error_ok 'i341foo382e' => qr/\Amalformed integer data at 1\b/, 'malformed integer'; +decod_ok 'i4e' => 4; +decod_ok 'i0e' => 0; +decod_ok 'i123456789e' => 123456789; +decod_ok 'i-10e' => -10; +error_ok 'i-0e' => qr/\Amalformed integer data at 1\b/, 'negative zero integer'; +error_ok 'i123' => qr/\Amalformed integer data at 1\b/, 'unterminated integer'; +error_ok '' => qr/\Aunexpected end of data at 0/, 'empty data'; +error_ok '1:' => qr/\Aunexpected end of string data starting at 2\b/, 'string longer than data'; +error_ok 'i6easd' => qr/\Atrailing garbage at 3\b/, 'integer with trailing garbage'; +error_ok '35208734823ljdahflajhdf' => qr/\Agarbage at 0/, 'garbage looking vaguely like a string, with large count'; +error_ok '2:abfdjslhfld' => qr/\Atrailing garbage at 4\b/, 'string with trailing garbage'; +decod_ok '0:' => ''; +decod_ok '3:abc' => 'abc'; +decod_ok '10:1234567890' => '1234567890'; +error_ok '02:xy' => qr/\Amalformed string length at 0\b/, 'string with extra leading zero in count'; +error_ok 'l' => qr/\Aunexpected end of data at 1\b/, 'unclosed empty list'; +decod_ok 'le' => []; +error_ok 'leanfdldjfh' => qr/\Atrailing garbage at 2\b/, 'empty list with trailing garbage'; +decod_ok 'l0:0:0:e' => [ '', '', '' ]; +error_ok 'relwjhrlewjh' => qr/\Agarbage at 0/, 'complete garbage'; +decod_ok 'li1ei2ei3ee' => [ 1, 2, 3 ]; +decod_ok 'l3:asd2:xye' => [ 'asd', 'xy' ]; +decod_ok 'll5:Alice3:Bobeli2ei3eee' => [ [ 'Alice', 'Bob' ], [ 2, 3 ] ]; +error_ok 'd' => qr/\Aunexpected end of data at 1\b/, 'unclosed empty dict'; +error_ok 'defoobar' => qr/\Atrailing garbage at 2\b/, 'empty dict with trailing garbage'; +decod_ok 'de' => {}; +decod_ok 'd3:agei25e4:eyes4:bluee' => { 'age' => 25, 'eyes' => 'blue' }; +decod_ok 'd8:spam.mp3d6:author5:Alice6:lengthi100000eee' => { 'spam.mp3' => { 'author' => 'Alice', 'length' => '100000' } }; +error_ok 'd3:fooe' => qr/\Adict key is missing value at 7\b/, 'dict with odd number of elements'; +error_ok 'di1e0:e' => qr/\Adict key is not a string at 1/, 'dict with integer key'; +error_ok 'd1:b0:1:a0:e' => qr/\Adict key not in sort order at 9/, 'missorted keys'; +error_ok 'd1:a0:1:a0:e' => qr/\Aduplicate dict key at 9/, 'duplicate keys'; +error_ok 'i03e' => qr/\Amalformed integer data at 1/, 'integer with leading zero'; +error_ok 'l01:ae' => qr/\Amalformed string length at 1/, 'list with string with leading zero in count'; +error_ok '9999:x' => qr/\Aunexpected end of string data starting at 5/, 'string shorter than count'; +error_ok 'l0:' => qr/\Aunexpected end of data at 3/, 'unclosed list with content'; +error_ok 'd0:0:' => qr/\Aunexpected end of data at 5/, 'unclosed dict with content'; +error_ok 'd0:' => qr/\Aunexpected end of data at 3/, 'unclosed dict with odd number of elements'; +error_ok '00:' => qr/\Amalformed string length at 0/, 'zero-length string with extra leading zero in count'; +error_ok 'l-3:e' => qr/\Amalformed string length at 1/, 'list with negative-length string'; +error_ok 'i-03e' => qr/\Amalformed integer data at 1/, 'negative integer with leading zero'; +decod_ok "2:\x0A\x0D" => "\x0A\x0D"; + +decod_ok ['d1:a0:e', 0, 1] => { a => '' }, # Accept single dict when max_depth is 1 +error_ok ['d1:a0:e', 0, 0] => qr/\Anesting depth exceeded at 1/, 'single dict when max_depth is 0'; +decod_ok ['d1:ad1:a0:ee', 0, 2] => { a => { a => '' } }, # Accept a nested dict when max_depth is 2 +error_ok ['d1:ad1:a0:ee', 0, 1] => qr/\Anesting depth exceeded at 5/, 'nested dict when max_depth is 1'; +decod_ok ['l0:e', 0, 1] => [ '' ], # Accept single list when max_depth is 1 +error_ok ['l0:e', 0, 0] => qr/\Anesting depth exceeded at 1/, 'single list when max_depth is 0'; +decod_ok ['ll0:ee', 0, 2] => [ [ '' ] ], # Accept a nested list when max_depth is 2 +error_ok ['ll0:ee', 0, 1] => qr/\Anesting depth exceeded at 2/, 'nested list when max_depth is 1'; +decod_ok ['d1:al0:ee', 0, 2] => { a => [ '' ] }, # Accept dict containing list when max_depth is 2 +error_ok ['d1:al0:ee', 0, 1] => qr/\Anesting depth exceeded at 5/, 'list in dict when max_depth is 1'; +decod_ok ['ld1:a0:ee', 0, 2] => [ { 'a' => '' } ], # Accept list containing dict when max_depth is 2 +error_ok ['ld1:a0:ee', 0, 1] => qr/\Anesting depth exceeded at 2/, 'dict in list when max_depth is 1'; +decod_ok ['d1:a0:1:bl0:ee', 0, 2] => { a => '', b => [ '' ] }, # Accept dict containing list when max_depth is 2 +error_ok ['d1:a0:1:bl0:ee', 0, 1] => qr/\Anesting depth exceeded at 10/, 'list in dict when max_depth is 1'; + +eq_or_diff( + bdecode( 'd1:b0:1:a0:e', 1 ), + { a => '', b => '', }, + 'accept missorted keys when decoding leniently', +); + +done_testing; diff -Nru libbencode-perl-1.4/t/01.bdecode.t libbencode-perl-1.402/t/01.bdecode.t --- libbencode-perl-1.4/t/01.bdecode.t 2010-07-06 17:59:15.000000000 +0000 +++ libbencode-perl-1.402/t/01.bdecode.t 1970-01-01 00:00:00.000000000 +0000 @@ -1,102 +0,0 @@ -use Test::More; - -use Bencode qw( bdecode ); - -my @test = ( - '0:0:' => \[ qr/\Atrailing garbage at 2\b/, 'data past end of first correct bencoded string' ], - 'i' => \[ qr/\Aunexpected end of data at 1\b/, 'aborted integer' ], - 'i0' => \[ qr/\Amalformed integer data at 1\b/, 'unterminated integer' ], - 'ie' => \[ qr/\Amalformed integer data at 1\b/, 'empty integer' ], - 'i341foo382e' => \[ qr/\Amalformed integer data at 1\b/, 'malformed integer' ], - 'i4e' => 4, - 'i0e' => 0, - 'i123456789e' => 123456789, - 'i-10e' => -10, - 'i-0e' => \[ qr/\Amalformed integer data at 1\b/, 'negative zero integer' ], - 'i123' => \[ qr/\Amalformed integer data at 1\b/, 'unterminated integer' ], - '' => \[ qr/\Aunexpected end of data at 0/, 'empty data' ], - '1:' => \[ qr/\Aunexpected end of string data starting at 2\b/, 'string longer than data' ], - 'i6easd' => \[ qr/\Atrailing garbage at 3\b/, 'integer with trailing garbage' ], - '35208734823ljdahflajhdf' => \[ qr/\Agarbage at 0/, 'garbage looking vaguely like a string, with large count' ], - '2:abfdjslhfld' => \[ qr/\Atrailing garbage at 4\b/, 'string with trailing garbage' ], - '0:' => '', - '3:abc' => 'abc', - '10:1234567890' => '1234567890', - '02:xy' => \[ qr/\Amalformed string length at 0\b/, 'string with extra leading zero in count' ], - 'l' => \[ qr/\Aunexpected end of data at 1\b/, 'unclosed empty list' ], - 'le' => [], - 'leanfdldjfh' => \[ qr/\Atrailing garbage at 2\b/, 'empty list with trailing garbage' ], - 'l0:0:0:e' => [ '', '', '' ], - 'relwjhrlewjh' => \[ qr/\Agarbage at 0/, 'complete garbage' ], - 'li1ei2ei3ee' => [ 1, 2, 3 ], - 'l3:asd2:xye' => [ 'asd', 'xy' ], - 'll5:Alice3:Bobeli2ei3eee' => [ [ 'Alice', 'Bob' ], [ 2, 3 ] ], - 'd' => \[ qr/\Aunexpected end of data at 1\b/, 'unclosed empty dict' ], - 'defoobar' => \[ qr/\Atrailing garbage at 2\b/, 'empty dict with trailing garbage' ], - 'de' => {}, - 'd3:agei25e4:eyes4:bluee' => { 'age' => 25, 'eyes' => 'blue' }, - 'd8:spam.mp3d6:author5:Alice6:lengthi100000eee' => { 'spam.mp3' => { 'author' => 'Alice', 'length' => 100000 } }, - 'd3:fooe' => \[ qr/\Adict key is missing value at 7\b/, 'dict with odd number of elements' ], - 'di1e0:e' => \[ qr/\Adict key is not a string at 1/, 'dict with integer key' ], - 'd1:b0:1:a0:e' => \[ qr/\Adict key not in sort order at 9/, 'missorted keys' ], - 'd1:a0:1:a0:e' => \[ qr/\Aduplicate dict key at 9/, 'duplicate keys' ], - 'i03e' => \[ qr/\Amalformed integer data at 1/, 'integer with leading zero' ], - 'l01:ae' => \[ qr/\Amalformed string length at 1/, 'list with string with leading zero in count' ], - '9999:x' => \[ qr/\Aunexpected end of string data starting at 5/, 'string shorter than count' ], - 'l0:' => \[ qr/\Aunexpected end of data at 3/, 'unclosed list with content' ], - 'd0:0:' => \[ qr/\Aunexpected end of data at 5/, 'unclosed dict with content' ], - 'd0:' => \[ qr/\Aunexpected end of data at 3/, 'unclosed dict with odd number of elements' ], - '00:' => \[ qr/\Amalformed string length at 0/, 'zero-length string with extra leading zero in count' ], - 'l-3:e' => \[ qr/\Amalformed string length at 1/, 'list with negative-length string' ], - 'i-03e' => \[ qr/\Amalformed integer data at 1/, 'negative integer with leading zero' ], - "2:\x0A\x0D" => "\x0A\x0D", - ['d1:a0:e', 0, 1] => { a => '' }, # Accept single dict when max_depth is 1 - ['d1:a0:e', 0, 0] => \[ qr/\Anesting depth exceeded at 1/, 'single dict when max_depth is 0' ], - ['d1:ad1:a0:ee', 0, 2] => { a => { a => '' } }, # Accept a nested dict when max_depth is 2 - ['d1:ad1:a0:ee', 0, 1] => \[ qr/\Anesting depth exceeded at 5/, 'nested dict when max_depth is 1' ], - ['l0:e', 0, 1] => [ '' ], # Accept single list when max_depth is 1 - ['l0:e', 0, 0] => \[ qr/\Anesting depth exceeded at 1/, 'single list when max_depth is 0' ], - ['ll0:ee', 0, 2] => [ [ '' ] ], # Accept a nested list when max_depth is 2 - ['ll0:ee', 0, 1] => \[ qr/\Anesting depth exceeded at 2/, 'nested list when max_depth is 1' ], - ['d1:al0:ee', 0, 2] => { a => [ '' ] }, # Accept dict containing list when max_depth is 2 - ['d1:al0:ee', 0, 1] => \[ qr/\Anesting depth exceeded at 5/, 'list in dict when max_depth is 1' ], - ['ld1:a0:ee', 0, 2] => [ { 'a' => '' } ], # Accept list containing dict when max_depth is 2 - ['ld1:a0:ee', 0, 1] => \[ qr/\Anesting depth exceeded at 2/, 'dict in list when max_depth is 1' ], - ['d1:a0:1:bl0:ee', 0, 2] => { a => '', b => [ '' ] }, # Accept dict containing list when max_depth is 2 - ['d1:a0:1:bl0:ee', 0, 1] => \[ qr/\Anesting depth exceeded at 10/, 'list in dict when max_depth is 1' ], -); - -plan tests => 1 + @test / 2; - -while ( my ( $frozen, $thawed ) = splice @test, 0, 2 ) { - my $result; - my $testname; - my $lived = eval { - if ( ref $frozen eq 'ARRAY' ) { - local $, = ', '; - $testname = "decode [@$frozen]"; - $result = bdecode( @$frozen ); - } - else { - $testname = "decode '$frozen'"; - $result = bdecode( $frozen ); - } - 1 - }; - - if ( ref $thawed ne 'REF' ) { - is_deeply( $result, $thawed, $testname ); - } - else { - my ( $error_rx, $kind_of_brokenness ) = @$$thawed; - like( $@, $error_rx, "reject $kind_of_brokenness" ); - } -} - -is_deeply( - bdecode( 'd1:b0:1:a0:e', 1 ), - { a => '', b => '', }, - 'accept missorted keys when decoding leniently', -); - -# vim: set ft=perl: diff -Nru libbencode-perl-1.4/t/02-bencode.t libbencode-perl-1.402/t/02-bencode.t --- libbencode-perl-1.4/t/02-bencode.t 1970-01-01 00:00:00.000000000 +0000 +++ libbencode-perl-1.402/t/02-bencode.t 2015-01-10 10:30:34.000000000 +0000 @@ -0,0 +1,28 @@ +use strict; +use warnings; + +use Test::More 0.88; # for done_testing +use Test::Differences; +use Bencode 'bencode'; + +sub enc_ok { + my ( $frozen, $thawed ) = @_; + local $Test::Builder::Level = $Test::Builder::Level + 1; + eq_or_diff bencode( $thawed ), $frozen, "encode $frozen"; +} + +enc_ok 'i4e' => 4; +enc_ok 'i0e' => 0; +enc_ok 'i-10e' => -10; +enc_ok 'i12345678901234567890e' => '12345678901234567890'; +enc_ok '0:' => ''; +enc_ok '3:abc' => 'abc'; +enc_ok '10:1234567890' => \'1234567890'; +enc_ok 'le' => []; +enc_ok 'li1ei2ei3ee' => [ 1, 2, 3 ]; +enc_ok 'll5:Alice3:Bobeli2ei3eee' => [ [ 'Alice', 'Bob' ], [ 2, 3 ] ]; +enc_ok 'de' => {}; +enc_ok 'd3:agei25e4:eyes4:bluee' => { 'age' => 25, 'eyes' => 'blue' }; +enc_ok 'd8:spam.mp3d6:author5:Alice6:lengthi100000eee' => { 'spam.mp3' => { 'author' => 'Alice', 'length' => 100000 } }; + +done_testing; diff -Nru libbencode-perl-1.4/t/02.bencode.t libbencode-perl-1.402/t/02.bencode.t --- libbencode-perl-1.4/t/02.bencode.t 2010-07-06 17:59:15.000000000 +0000 +++ libbencode-perl-1.402/t/02.bencode.t 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -use Test::More; - -use Bencode qw( bencode ); - -my @test = ( - 'i4e' => 4, - 'i0e' => 0, - 'i-10e' => -10, - 'i12345678901234567890e' => '12345678901234567890', - '0:' => '', - '3:abc' => 'abc', - '10:1234567890' => \'1234567890', - 'le' => [], - 'li1ei2ei3ee' => [ 1, 2, 3 ], - 'll5:Alice3:Bobeli2ei3eee' => [ [ 'Alice', 'Bob' ], [ 2, 3 ] ], - 'de' => {}, - 'd3:agei25e4:eyes4:bluee' => { 'age' => 25, 'eyes' => 'blue' }, - 'd8:spam.mp3d6:author5:Alice6:lengthi100000eee' => { 'spam.mp3' => { 'author' => 'Alice', 'length' => 100000 } }, -); - -plan tests => 0 + @test / 2; - -while ( my ( $frozen, $thawed ) = splice @test, 0, 2 ) { - is_deeply( bencode( $thawed ), $frozen, "encode $frozen" ); -} - -# vim: set ft=perl: diff -Nru libbencode-perl-1.4/t/cpants.t libbencode-perl-1.402/t/cpants.t --- libbencode-perl-1.4/t/cpants.t 2010-07-06 17:59:15.000000000 +0000 +++ libbencode-perl-1.402/t/cpants.t 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -use Test::More skip_all => 'This is just to fob CPANTS'; -eval 'use Test::Pod::Coverage'; -eval 'use Test::Pod';