diff options
author | gregor herrmann <gregoa@debian.org> | 2022-08-18 21:42:11 +0200 |
---|---|---|
committer | gregor herrmann <gregoa@debian.org> | 2022-08-18 21:42:11 +0200 |
commit | a59d72c7a68c094baa5e9393e7500b3209abd7aa (patch) | |
tree | 339b5ef6562658fb0da892c6e08f5c3070f90bfb | |
parent | 36714f08891bd0d06fb083df3aafa4fcd6914f38 (diff) | |
parent | 6ef8b2042d20a9362a00e75102d8ad0db41fe64f (diff) |
Update upstream source from tag 'upstream/1.502'
Update to upstream version '1.502'
with Debian dir 038b6a020cbc10ee3ef3f45567361fa1a7d1cbf5
-rw-r--r-- | Changes | 6 | ||||
-rw-r--r-- | LICENSE | 1 | ||||
-rw-r--r-- | MANIFEST | 15 | ||||
-rw-r--r-- | META.json | 36 | ||||
-rw-r--r-- | META.yml | 31 | ||||
-rw-r--r-- | Makefile.PL | 130 | ||||
-rw-r--r-- | README | 4 | ||||
-rw-r--r-- | cpanfile | 11 | ||||
-rw-r--r-- | dist.ini | 27 | ||||
-rw-r--r-- | inc/boilerplate.pl | 50 | ||||
-rw-r--r-- | lib/Bencode.pm | 8 | ||||
-rw-r--r-- | t/00-load.t | 25 |
12 files changed, 214 insertions, 130 deletions
@@ -1,4 +1,8 @@ -Revision history for Bencode +Release history for Bencode + +1.502 Tue 09 Aug 2022 + - No functional changes + - Updated package tooling and metadata 1.501 Sat 30 Sep 2017 - No test failures under Carp < 1.25 @@ -376,4 +376,3 @@ WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End - @@ -1,13 +1,12 @@ -# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.034. Changes -LICENSE -MANIFEST -META.json -META.yml Makefile.PL -README -cpanfile -dist.ini +inc/boilerplate.pl lib/Bencode.pm +t/00-load.t t/01-bdecode.t t/02-bencode.t +MANIFEST +META.yml Module YAML meta-data (added by MakeMaker) +META.json Module JSON meta-data (added by MakeMaker) +LICENSE +README @@ -4,7 +4,7 @@ "Aristotle Pagaltzis <pagaltzis@gmx.de>" ], "dynamic_config" : 0, - "generated_by" : "Dist::Zilla version 5.034, CPAN::Meta::Converter version 2.143240", + "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], @@ -13,18 +13,19 @@ "version" : 2 }, "name" : "Bencode", + "no_index" : { + "directory" : [ + "t", + "inc" + ] + }, "prereqs" : { - "configure" : { - "requires" : { - "ExtUtils::MakeMaker" : "0" - } - }, + "build" : {}, + "configure" : {}, "runtime" : { "requires" : { "Exporter::Tidy" : "0", - "perl" : "5.006", - "strict" : "0", - "warnings" : "0" + "perl" : "5.006" } }, "test" : { @@ -37,14 +38,21 @@ "release_status" : "stable", "resources" : { "bugtracker" : { - "web" : "http://github.com/ap/Bencode/issues" + "web" : "https://rt.cpan.org/Public/Dist/Display.html?Name=Bencode" }, + "license" : [ + "http://dev.perl.org/licenses/" + ], "repository" : { "type" : "git", - "url" : "git://github.com/ap/Bencode", - "web" : "http://github.com/ap/Bencode" + "url" : "https://github.com/ap/Bencode.git", + "web" : "https://github.com/ap/Bencode" } }, - "version" : "1.501" + "version" : "1.502", + "x_copyright" : { + "holder" : "Aristotle Pagaltzis", + "year" : 2017 + }, + "x_serialization_backend" : "JSON::PP version 4.02" } - @@ -3,23 +3,28 @@ abstract: 'BitTorrent serialisation format' author: - 'Aristotle Pagaltzis <pagaltzis@gmx.de>' build_requires: - Test::Differences: 0 - Test::More: 0 -configure_requires: - ExtUtils::MakeMaker: 0 + Test::Differences: '0' + Test::More: '0' dynamic_config: 0 -generated_by: 'Dist::Zilla version 5.034, CPAN::Meta::Converter version 2.143240' +generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html - version: 1.4 + version: '1.4' name: Bencode +no_index: + directory: + - t + - inc requires: - Exporter::Tidy: 0 - perl: 5.006 - strict: 0 - warnings: 0 + Exporter::Tidy: '0' + perl: '5.006' resources: - bugtracker: http://github.com/ap/Bencode/issues - repository: git://github.com/ap/Bencode -version: 1.501 + bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Bencode + license: http://dev.perl.org/licenses/ + repository: https://github.com/ap/Bencode.git +version: '1.502' +x_copyright: + holder: 'Aristotle Pagaltzis' + year: 2017 +x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff --git a/Makefile.PL b/Makefile.PL index fec7c37..6826736 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,55 +1,91 @@ -# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.034. -use strict; -use warnings; - -use 5.006; - -use ExtUtils::MakeMaker; - -my %WriteMakefileArgs = ( - "ABSTRACT" => "BitTorrent serialisation format", - "AUTHOR" => "Aristotle Pagaltzis <pagaltzis\@gmx.de>", - "CONFIGURE_REQUIRES" => { - "ExtUtils::MakeMaker" => 0 - }, - "DISTNAME" => "Bencode", - "EXE_FILES" => [], - "LICENSE" => "perl", - "MIN_PERL_VERSION" => "5.006", - "NAME" => "Bencode", - "PREREQ_PM" => { - "Exporter::Tidy" => 0, - "strict" => 0, - "warnings" => 0 - }, - "TEST_REQUIRES" => { - "Test::Differences" => 0, - "Test::More" => 0 - }, - "VERSION" => "1.501", - "test" => { - "TESTS" => "t/*.t" - } -); +use 5.006; use strict; use warnings; +my $sc = q<https://github.com/ap/Bencode>; +my $bt = q<https://rt.cpan.org/Public/Dist/Display.html?Name=Bencode>; -my %FallbackPrereqs = ( - "Exporter::Tidy" => 0, - "ExtUtils::MakeMaker" => 0, - "Test::Differences" => 0, - "Test::More" => 0, - "strict" => 0, - "warnings" => 0 +my %META = ( + name => 'Bencode', + author => 'Aristotle Pagaltzis <pagaltzis@gmx.de>', + x_copyright => { holder => 'Aristotle Pagaltzis', year => 2017 }, + license => 'perl_5', + resources => { + license => [ 'http://dev.perl.org/licenses/' ], + repository => { type => 'git', url => "$sc.git", web => $sc }, + bugtracker => { web => $bt }, + }, + dynamic_config => 0, + prereqs => { + runtime => { + requires => {qw( + perl 5.006 + Exporter::Tidy 0 + )}, + }, + test => { + requires => {qw( + Test::Differences 0 + Test::More 0 + )}, + }, + }, ); +sub MY::postamble { -f 'META.yml' ? return : <<'' } +create_distdir : MANIFEST +distdir : MANIFEST +MANIFEST : + ( git ls-files ':!README.pod' ; echo MANIFEST ) > MANIFEST +distdir : boilerplate +.PHONY : boilerplate +boilerplate : distmeta + $(PERL) -Ilib inc/boilerplate.pl $(DISTVNAME) + +## BOILERPLATE ############################################################### +require ExtUtils::MakeMaker; + +my %MM_ARGS; + +# have to do this since old EUMM dev releases miss the eval $VERSION line +my $eumm_version = eval $ExtUtils::MakeMaker::VERSION; +my $mymeta = $eumm_version >= 6.57_02; +my $mymeta_broken = $mymeta && $eumm_version < 6.57_07; -unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { - delete $WriteMakefileArgs{TEST_REQUIRES}; - delete $WriteMakefileArgs{BUILD_REQUIRES}; - $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; +(my $basepath = (-d 'lib' && 'lib/') . $META{name}) =~ s{-}{/}g; + +($MM_ARGS{NAME} = $META{name}) =~ s/-/::/g; +$MM_ARGS{VERSION_FROM} = "$basepath.pm"; +$MM_ARGS{ABSTRACT_FROM} = -f "$basepath.pod" ? "$basepath.pod" : "$basepath.pm"; +$META{license} = [ $META{license} ] + if $META{license} && !ref $META{license}; +$MM_ARGS{LICENSE} = $META{license}[0] + if $META{license} && $eumm_version >= 6.30; +$MM_ARGS{NO_MYMETA} = 1 + if $mymeta_broken; +$MM_ARGS{META_ADD} = { 'meta-spec' => { version => 2 }, %META } + unless -f 'META.yml'; +$MM_ARGS{PL_FILES} ||= {}; +$MM_ARGS{NORECURS} = 1 + if not exists $MM_ARGS{NORECURS}; + +for (qw(configure build test runtime)) { + my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES'; + my $r = $MM_ARGS{$key} = { + %{$META{prereqs}{$_}{requires} || {}}, + %{delete $MM_ARGS{$key} || {}}, + }; + defined $r->{$_} or delete $r->{$_} for keys %$r; } -delete $WriteMakefileArgs{CONFIGURE_REQUIRES} - unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; +$MM_ARGS{MIN_PERL_VERSION} = eval delete $MM_ARGS{PREREQ_PM}{perl} || 0; + +delete $MM_ARGS{MIN_PERL_VERSION} + if $eumm_version < 6.47_01; +$MM_ARGS{BUILD_REQUIRES} = {%{$MM_ARGS{BUILD_REQUIRES}}, %{delete $MM_ARGS{TEST_REQUIRES}}} + if $eumm_version < 6.63_03; +$MM_ARGS{PREREQ_PM} = {%{$MM_ARGS{PREREQ_PM}}, %{delete $MM_ARGS{BUILD_REQUIRES}}} + if $eumm_version < 6.55_01; +delete $MM_ARGS{CONFIGURE_REQUIRES} + if $eumm_version < 6.51_03; -WriteMakefile(%WriteMakefileArgs); +ExtUtils::MakeMaker::WriteMakefile(%MM_ARGS); +## END BOILERPLATE ########################################################### @@ -24,5 +24,5 @@ COPYRIGHT AND LICENSE This software is copyright (c) 2017 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. +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 --git a/cpanfile b/cpanfile deleted file mode 100644 index 5d9a27b..0000000 --- a/cpanfile +++ /dev/null @@ -1,11 +0,0 @@ -requires 'perl', '5.006'; -requires 'strict'; -requires 'warnings'; -requires 'Exporter::Tidy'; - -on test => sub { - requires 'Test::Differences'; - requires 'Test::More'; -}; - -# vim: ft=perl diff --git a/dist.ini b/dist.ini deleted file mode 100644 index 9fec569..0000000 --- a/dist.ini +++ /dev/null @@ -1,27 +0,0 @@ -name = Bencode -version = 1.501 -author = Aristotle Pagaltzis <pagaltzis@gmx.de> -license = Perl_5 -copyright_holder = Aristotle Pagaltzis -copyright_year = 2017 - -[MetaResources] -repository.type = git -repository.url = git://github.com/ap/Bencode -repository.web = http://github.com/ap/Bencode -bugtracker.web = http://github.com/ap/Bencode/issues - -[@Filter / @Basic] --bundle = @Basic --remove = Readme - -[MetaJSON] -[PkgVersion] -[PruneFiles] -filename = README.pod - -; non-core plugins -[CheckChangeLog] -[Prereqs::FromCPANfile] -[Readme::Brief] -[PodWeaver] diff --git a/inc/boilerplate.pl b/inc/boilerplate.pl new file mode 100644 index 0000000..dd50f62 --- /dev/null +++ b/inc/boilerplate.pl @@ -0,0 +1,50 @@ +use strict; use warnings; + +use CPAN::Meta; +use Software::LicenseUtils 0.103011; +use Pod::Readme::Brief 1.001; + +sub slurp { open my $fh, '<', $_[0] or die "Couldn't open $_[0] to read: $!\n"; local $/; readline $fh } +sub trimnl { s/\A\s*\n//, s/\s*\z/\n/ for @_; wantarray ? @_ : $_[-1] } +sub mkparentdirs { + my @dir = do { my %seen; sort grep s!/[^/]+\z!! && !$seen{ $_ }++, my @copy = @_ }; + if ( @dir ) { mkparentdirs( @dir ); mkdir for @dir } +} + +chdir $ARGV[0] or die "Cannot chdir to $ARGV[0]: $!\n"; + +my %file; + +my $meta = CPAN::Meta->load_file( 'META.json' ); + +my $license = do { + my @key = ( $meta->license, $meta->meta_spec_version ); + my ( $class, @ambiguous ) = Software::LicenseUtils->guess_license_from_meta_key( @key ); + die if @ambiguous or not $class; + $class->new( $meta->custom( 'x_copyright' ) ); +}; + +$file{'LICENSE'} = trimnl $license->fulltext; + +my ( $main_module ) = map { s!-!/!g; s!^!lib/! if -d 'lib'; -f "$_.pod" ? "$_.pod" : "$_.pm" } $meta->name; + +( $file{ $main_module } = slurp $main_module ) =~ s{(^=cut\s*\z)}{ join "\n", ( + "=head1 AUTHOR\n", trimnl( $meta->authors ), + "=head1 COPYRIGHT AND LICENSE\n", trimnl( $license->notice ), + "=cut\n", +) }me; + +die unless -e 'Makefile.PL'; +$file{'README'} = Pod::Readme::Brief->new( $file{ $main_module } )->render( installer => 'eumm' ); + +my @manifest = split /\n/, slurp 'MANIFEST'; +my %manifest = map /\A([^\s#]+)()/, @manifest; +$file{'MANIFEST'} = join "\n", @manifest, ( sort grep !exists $manifest{ $_ }, keys %file ), ''; + +mkparentdirs sort keys %file; +for my $fn ( sort keys %file ) { + unlink $fn if -e $fn; + open my $fh, '>', $fn or die "Couldn't open $fn to write: $!\n"; + print $fh $file{ $fn }; + close $fh or die "Couldn't close $fn after writing: $!\n"; +} diff --git a/lib/Bencode.pm b/lib/Bencode.pm index 2b9b1c1..9adde17 100644 --- a/lib/Bencode.pm +++ b/lib/Bencode.pm @@ -3,8 +3,7 @@ use strict; use warnings; package Bencode; -$Bencode::VERSION = '1.501'; -# ABSTRACT: BitTorrent serialisation format +our $VERSION = '1.502'; use Exporter::Tidy all => [qw( bencode bdecode )]; @@ -154,10 +153,6 @@ __END__ Bencode - BitTorrent serialisation format -=head1 VERSION - -version 1.501 - =head1 SYNOPSIS use Bencode qw( bencode bdecode ); @@ -166,6 +161,7 @@ version 1.501 print $bencoded, "\n"; my $decoded = bdecode $bencoded; + =head1 DESCRIPTION This module implements the BitTorrent I<bencode> serialisation format, diff --git a/t/00-load.t b/t/00-load.t new file mode 100644 index 0000000..ab23c86 --- /dev/null +++ b/t/00-load.t @@ -0,0 +1,25 @@ +use strict; use warnings; + +use Test::More; + +BEGIN { # compat shim for old Test::More + defined &BAIL_OUT or *BAIL_OUT = sub { + my $t = Test::Builder->new; + $t->no_ending(1); # needed before Test::Builder 0.61 + $t->BAILOUT(@_); # added in Test::Builder 0.40 + }; +} + +my @module = qw( + Bencode +); + +plan tests => 0+@module; + +diag "Testing on Perl $] at $^X"; + +for my $module ( @module ) { + use_ok( $module ) or BAIL_OUT "Cannot load module '$module'"; + no warnings 'uninitialized'; + diag "Testing $module @ " . $module->VERSION; +} |