3 # This chunk of stuff was generated by App::FatPacker. To find the original
4 # file's code, look for the end of this BEGIN block or the string 'FATPACK'
8 $fatpacked{"MetaCPAN/API/Tiny.pm"} = <<'METACPAN_API_TINY';
9 package MetaCPAN::API::Tiny;
11 $MetaCPAN::API::Tiny::VERSION = '1.131730';
15 # ABSTRACT: A Tiny API client for MetaCPAN
18 use JSON::PP 'encode_json', 'decode_json';
23 my ($class, @args) = @_;
26 or croak 'Arguments must be provided as name/value pairs';
30 die 'ua_args must be an array reference'
31 if $params{ua_args} && ref($params{ua_args}) ne 'ARRAY';
34 base_url => $params{base_url} || 'https://api.metacpan.org/v0',
35 ua => $params{ua} || HTTP::Tiny->new(
38 : (agent => 'MetaCPAN::API::Tiny/'
39 . ($MetaCPAN::API::VERSION || 'xx'))),
42 return bless($self, $class);
45 sub _build_extra_params {
49 or croak 'Incorrect number of params, must be key/value';
54 foreach my $key (keys %extra)
56 # The implementation in HTTP::Tiny uses + instead of %20, fix that
57 $extra{$key} = $ua->_uri_escape($extra{$key});
58 $extra{$key} =~ s/\+/%20/g;
61 my $params = join '&', map { "$_=" . $extra{$_} } sort keys %extra;
67 # /source/{author}/{release}/{path}
70 my %opts = @_ ? @_ : ();
72 my $error = "Provide 'author' and 'release' and 'path'";
74 %opts or croak $error;
77 defined ( my $author = $opts{'author'} ) &&
78 defined ( my $release = $opts{'release'} ) &&
79 defined ( my $path = $opts{'path'} )
81 $url = "source/$author/$release/$path";
86 $url = $self->{base_url} . "/$url";
88 my $result = $self->{ua}->get($url);
90 or croak "Failed to fetch '$url': " . $result->{'reason'};
92 return $result->{'content'};
96 # /release/{distribution}
97 # /release/{author}/{release}
100 my %opts = @_ ? @_ : ();
102 my $error = "Either provide 'distribution', or 'author' and 'release', " .
105 %opts or croak $error;
109 if ( defined ( my $dist = $opts{'distribution'} ) ) {
110 $url = "release/$dist";
112 defined ( my $author = $opts{'author'} ) &&
113 defined ( my $release = $opts{'release'} )
115 $url = "release/$author/$release";
116 } elsif ( defined ( my $search_opts = $opts{'search'} ) ) {
117 ref $search_opts && ref $search_opts eq 'HASH'
120 %extra_opts = %{$search_opts};
121 $url = 'release/_search';
126 return $self->fetch( $url, %extra_opts );
131 # /pod/{author}/{release}/{path}
134 my %opts = @_ ? @_ : ();
136 my $error = "Either provide 'module' or 'author and 'release' and 'path'";
138 %opts or croak $error;
140 if ( defined ( my $module = $opts{'module'} ) ) {
141 $url = "pod/$module";
143 defined ( my $author = $opts{'author'} ) &&
144 defined ( my $release = $opts{'release'} ) &&
145 defined ( my $path = $opts{'path'} )
147 $url = "pod/$author/$release/$path";
154 if ( defined ( my $type = $opts{'content-type'} ) ) {
155 $type =~ m{^ text/ (?: html|plain|x-pod|x-markdown ) $}x
156 or croak 'Incorrect content-type provided';
158 $extra{headers}{'content-type'} = $type;
161 $url = $self->{base_url}. "/$url";
163 my $result = $self->{ua}->get( $url, \%extra );
165 or croak "Failed to fetch '$url': " . $result->{'reason'};
167 return $result->{'content'};
176 $name or croak 'Please provide a module name';
178 return $self->fetch("module/$name");
182 # file() is a synonym of module
183 sub file { goto &module }
189 my ( $pause_id, $url, %extra_opts );
192 $url = 'author/' . shift;
193 } elsif ( @_ == 2 ) {
196 if ( defined $opts{'pauseid'} ) {
197 $url = "author/" . $opts{'pauseid'};
198 } elsif ( defined $opts{'search'} ) {
199 my $search_opts = $opts{'search'};
201 ref $search_opts && ref $search_opts eq 'HASH'
202 or croak "'search' key must be hashref";
204 %extra_opts = %{$search_opts};
205 $url = 'author/_search';
207 croak 'Unknown option given';
210 croak 'Please provide an author PAUSEID or a "search"';
213 return $self->fetch( $url, %extra_opts );
221 my $extra = $self->_build_extra_params(@_);
222 my $base = $self->{base_url};
223 my $req_url = $extra ? "$base/$url?$extra" : "$base/$url";
225 my $result = $self->{ua}->get($req_url);
226 return $self->_decode_result( $result, $req_url );
234 my $base = $self->{base_url};
237 or croak 'First argument of URL must be provided';
239 ref $query and ref $query eq 'HASH'
240 or croak 'Second argument of query hashref must be provided';
242 my $query_json = encode_json( $query );
243 my $result = $self->{ua}->request(
247 headers => { 'Content-Type' => 'application/json' },
248 content => $query_json,
252 return $self->_decode_result( $result, $url, $query_json );
257 my ( $result, $url, $original ) = @_;
260 ref $result and ref $result eq 'HASH'
261 or croak 'First argument must be hashref';
264 or croak 'Second argument of a URL must be provided';
266 if ( defined ( my $success = $result->{'success'} ) ) {
267 my $reason = $result->{'reason'} || '';
268 $reason .= ( defined $original ? " (request: $original)" : '' );
270 $success or croak "Failed to fetch '$url': $reason";
272 croak 'Missing success in return value';
275 defined ( my $content = $result->{'content'} )
276 or croak 'Missing content in return value';
278 eval { $decoded_result = decode_json $content; 1 }
279 or do { croak "Couldn't decode '$content': $@" };
281 return $decoded_result;
292 MetaCPAN::API::Tiny - A Tiny API client for MetaCPAN
300 This is the Tiny version of L<MetaCPAN::API>. It implements a compatible API
301 with a few notable exceptions:
305 =item Attributes are direct hash access
307 The attributes defined using Mo(o|u)se are now accessed via the blessed hash
308 directly. There are no accessors defined to access this elements.
310 =item Exception handling
312 Instead of using Try::Tiny, raw evals are used. This could potentially cause
313 issues, so just be aware.
317 Test::Fatal was replaced with an eval implementation of exception().
318 Test::TinyMocker usage is retained, but may be absorbed since it is pure perl
326 new is the constructor for MetaCPAN::API::Tiny. In the non-tiny version of this
327 module, this is provided via Any::Moose built from the attributes defined. In
328 the tiny version, we define our own constructor. It takes the same arguments
329 and provides similar checks to MetaCPAN::API with regards to arguments passed.
331 =head1 PUBLIC_METHODS
335 my $source = $mcpan->source(
337 release => 'Moose-2.0201',
338 path => 'lib/Moose.pm',
341 Searches MetaCPAN for a module or a specific release and returns the plain source.
345 my $result = $mcpan->release( distribution => 'Moose' );
348 my $result = $mcpan->release( author => 'DOY', release => 'Moose-2.0001' );
350 Searches MetaCPAN for a dist.
352 You can do complex searches using 'search' parameter:
354 # example lifted from MetaCPAN docs
355 my $result = $mcpan->release(
357 author => "OALDERS AND ",
358 filter => "status:latest",
366 my $result = $mcpan->pod( module => 'Moose' );
369 my $result = $mcpan->pod(
371 release => 'Moose-2.0201',
372 path => 'lib/Moose.pm',
375 Searches MetaCPAN for a module or a specific release and returns the POD.
379 my $result = $mcpan->module('MetaCPAN::API');
381 Searches MetaCPAN and returns a module's ".pm" file.
385 A synonym of L</module>
389 my $result1 = $mcpan->author('XSAWYERX');
390 my $result2 = $mcpan->author( pauseid => 'XSAWYERX' );
392 Searches MetaCPAN for a specific author.
394 You can do complex searches using 'search' parameter:
396 # example lifted from MetaCPAN docs
397 my $result = $mcpan->author(
399 q => 'profile.name:twitter',
406 my $result = $mcpan->fetch('/release/distribution/Moose');
409 my $more = $mcpan->fetch(
410 '/release/distribution/Moose',
414 This is a helper method for API implementations. It fetches a path from MetaCPAN, decodes the JSON from the content variable and returns it.
416 You don't really need to use it, but you can in case you want to write your own extension implementation to MetaCPAN::API.
418 It accepts an additional hash as "GET" parameters.
422 # /release&content={"query":{"match_all":{}},"filter":{"prefix":{"archive":"Cache-Cache-1.06"}}}
423 my $result = $mcpan->post(
426 query => { match_all => {} },
427 filter => { prefix => { archive => 'Cache-Cache-1.06' } },
431 The POST equivalent of the "fetch()" method. It gets the path and JSON request.
435 Overall the tests and code were ripped directly from MetaCPAN::API and
436 tiny-fied. A big thanks to Sawyer X for writing the original module.
442 =head1 COPYRIGHT AND LICENSE
446 This is free software; you can redistribute it and/or modify it under
447 the same terms as the Perl 5 programming language system itself.
452 s/^ //mg for values %fatpacked;
455 if (my $fat = $fatpacked{$_[1]}) {
458 return 0 unless length $fat;
459 $fat =~ s/^([^\n]*\n?)//;
464 open my $fh, '<', \$fat
465 or die "FatPacker error loading $_[1] (could be a perl installation issue?)";
471 } # END OF FATPACK CODE
477 use Fatal qw(open close);
482 use File::Path qw(make_path);
483 use Module::CoreList;
486 use MetaCPAN::API::Tiny;
487 use Digest::SHA qw(sha256_hex);
489 $Text::Wrap::columns = 62;
491 # Below, 5.036 should be aligned with the version of perl actually
492 # bundled in Buildroot:
493 die <<"MSG" if $] < 5.036;
494 This script needs a host perl with the same major version as Buildroot target perl.
496 Your current host perl is:
500 You may install a local one by running:
501 perlbrew install perl-5.36.0
504 my ($help, $man, $quiet, $force, $recommend, $test, $host);
506 GetOptions( 'help|?' => \$help,
508 'quiet|q' => \$quiet,
509 'force|f' => \$force,
511 'target!' => \$target,
512 'recommend' => \$recommend,
514 ) or pod2usage(-exitval => 1);
515 pod2usage(-exitval => 0) if $help;
516 pod2usage(-exitval => 0, -verbose => 2) if $man;
517 pod2usage(-exitval => 1) if scalar @ARGV == 0;
519 my %dist; # name -> metacpan data
520 my %need_target; # name -> 1 if target package is needed
521 my %need_host; # name -> 1 if host package is needed
522 my %need_dlopen; # name -> 1 if requires dynamic library
523 my %is_xs; # name -> 1 if XS module
524 my %deps_build; # name -> list of host dependencies
525 my %deps_runtime; # name -> list of target dependencies
526 my %license_files; # name -> hash of license files
527 my %checksum; # author -> list of checksum
528 my $mirror = 'https://cpan.metacpan.org'; # a CPAN mirror
529 my $mcpan = MetaCPAN::API::Tiny->new(base_url => 'https://fastapi.metacpan.org/v1');
530 my $ua = HTTP::Tiny->new();
534 'ExtUtils-Config' => 1,
535 'ExtUtils-InstallPaths' => 1,
536 'ExtUtils-Helpers' => 1,
537 'File-ShareDir-Install' => 1,
539 'Module-Build-Tiny' => 1,
545 my ($path) = $url =~ m|^[^:/?#]+://[^/?#]*([^?#]*)|;
546 my ($basename, $dirname) = fileparse( $path );
547 unless ($checksum{$dirname}) {
548 my $url = $mirror . $dirname . q{CHECKSUMS};
549 my $response = $ua->get($url);
550 $checksum{$dirname} = $response->{content};
552 my $chksum = Safe->new->reval($checksum{$dirname});
553 return $chksum->{$basename}, $basename;
558 # This heuristic determines if a module is a native extension, by searching
559 # some file extension types in the MANIFEST of the distribution.
560 # It was inspired by http://deps.cpantesters.org/static/purity.html
561 return $manifest =~ m/\.(swg|xs|c|h|i)[\n\s]/;
564 sub find_license_files {
567 foreach (split /\n/, $manifest) {
570 push @license_files, $_ if m/(ARTISTIC|COPYING|COPYRIGHT|GPL\S*|LICENSE|LICENCE)/i;
572 if (scalar @license_files == 0 && $manifest =~ m/(README)[\n\s]/i) {
573 @license_files = ($1);
575 if (scalar @license_files == 0 && $manifest =~ m/(README\.md)[\n\s]/i) {
576 @license_files = ($1);
578 if (scalar @license_files == 0 && $manifest =~ m/(README\.pod)[\n\s]/i) {
579 @license_files = ($1);
581 return @license_files;
586 return 1 if $need_dlopen{$distname} && scalar @{$deps_runtime{$distname}} > 0;
589 sub get_dependencies {
591 my %dep = map { $_ => 1 } @{$deps_runtime{$distname}};
592 for my $direct (@{$deps_runtime{$distname}}) {
593 for (get_dependencies( $direct )) {
600 sub get_indirect_dependencies {
603 my %direct = map { $_ => 1 } @{$deps_runtime{$distname}};
604 for my $dep (get_dependencies( $distname )) {
605 $indirect{$dep} = 1 unless exists $direct{$dep};
607 return keys %indirect;
611 my ($name, $need_target, $need_host, $top) = @_;
612 $need_target{$name} = $need_target if $need_target;
613 $need_host{$name} = $need_host if $need_host;
614 unless ($dist{$name} && !$top) {
615 say qq{fetch ${name}} unless $quiet;
616 my $result = $mcpan->release( distribution => $name );
617 my $main_module = $result->{main_module};
618 push @info, qq{[$name] $main_module is a core module}
619 if $top && Module::CoreList::is_core( $main_module, undef, $] );
620 $dist{$name} = $result;
621 $license_files{$name} = {};
623 my $author = $result->{author};
624 my $release = $name . q{-} . $result->{version};
625 my $manifest = $mcpan->source( author => $author, release => $release, path => 'MANIFEST' );
626 $need_dlopen{$name} = $is_xs{$name} = is_xs( $manifest );
627 foreach my $fname (find_license_files( $manifest )) {
628 my $license = $mcpan->source( author => $author, release => $release, path => $fname );
629 $license_files{$name}->{$fname} = sha256_hex( $license );
638 foreach my $dep (@{$result->{dependency}}) {
639 my $modname = ${$dep}{module};
640 next if $modname eq q{perl};
641 next if $modname =~ m|^Alien|;
642 next if $modname =~ m|^Win32|;
643 next if !($test && $top) && $modname =~ m|^Test|;
644 next if Module::CoreList::is_core( $modname, undef, $] );
645 # we could use the host Module::CoreList data, because host perl and
646 # target perl have the same major version
647 next if ${$dep}{phase} eq q{develop};
648 next if ${$dep}{phase} eq q{x_Dist_Zilla};
649 next if !($test && $top) && ${$dep}{phase} eq q{test};
650 my $distname = $mcpan->module( $modname )->{distribution};
651 if (${$dep}{phase} eq q{runtime}) {
652 if (${$dep}{relationship} eq q{requires}) {
653 $runtime{$distname} = 1;
656 $optional{$distname} = 1 if $recommend && $top;
659 else { # configure, build
660 $build{$distname} = 1;
661 push @info, qq{[$name] suspicious dependency on $distname}
662 unless exists $white_list{$distname};
665 $deps_build{$name} = [keys %build];
666 $deps_runtime{$name} = [keys %runtime];
667 foreach my $distname (@{$deps_build{$name}}) {
668 fetch( $distname, 0, 1 );
670 foreach my $distname (@{$deps_runtime{$name}}) {
671 fetch( $distname, $need_target, $need_host );
672 $need_dlopen{$name} ||= $need_dlopen{$distname};
674 foreach my $distname (keys %optional) {
675 fetch( $distname, $need_target, $need_host );
681 foreach my $distname (@ARGV) {
682 # Command-line's distributions
683 fetch( $distname, !!$target, !!$host, 1 );
685 say scalar keys %dist, q{ packages fetched.} unless $quiet;
687 # Buildroot package name: lowercase
691 return q{perl-} . lc $name;
694 # Buildroot variable name: uppercase
701 # Buildroot requires license name as in https://spdx.org/licenses/
704 $license =~ s|apache_1_1|Apache-1.1|;
705 $license =~ s|apache_2_0|Apache-2.0|;
706 $license =~ s|artistic_2|Artistic-2.0|;
707 $license =~ s|artistic|Artistic-1.0|;
708 $license =~ s|lgpl_2_1|LGPL-2.1|;
709 $license =~ s|lgpl_3_0|LGPL-3.0|;
710 $license =~ s|gpl_2|GPL-2.0|;
711 $license =~ s|gpl_3|GPL-3.0|;
712 $license =~ s|mit|MIT|;
713 $license =~ s|mozilla_1_1|Mozilla-1.1|;
714 $license =~ s|openssl|OpenSSL|;
715 $license =~ s|perl_5|Artistic or GPL-1.0+|;
719 while (my ($distname, $dist) = each %dist) {
720 my $fsname = fsname( $distname );
721 my $dirname = q{package/} . $fsname;
722 my $cfgname = $dirname . q{/Config.in};
723 my $mkname = $dirname . q{/} . $fsname . q{.mk};
724 my $hashname = $dirname . q{/} . $fsname . q{.hash};
725 my $brname = brname( $fsname );
726 my $testdir = q{support/testing/tests/package};
727 my $testname = $testdir . q{/test_} . lc $brname . q{.py};
728 unless (-d $dirname) {
732 if ($need_target{$distname} && ($force || !-f $cfgname)) {
733 $dist->{abstract} =~ s|\s+$||;
734 $dist->{abstract} .= q{.} unless $dist->{abstract} =~ m|\.$|;
735 my $abstract = wrap( q{}, qq{\t }, $dist->{abstract} );
736 my $homepage = $dist->{resources}->{homepage} || qq{https://metacpan.org/release/${distname}};
737 say qq{write ${cfgname}} unless $quiet;
738 open my $fh, q{>}, $cfgname;
739 say {$fh} qq{config BR2_PACKAGE_${brname}};
740 say {$fh} qq{\tbool "${fsname}"};
741 say {$fh} qq{\tdepends on !BR2_STATIC_LIBS} if $need_dlopen{$distname};
742 foreach my $dep (sort @{$deps_runtime{$distname}}) {
743 my $brdep = brname( fsname( $dep ) );
744 say {$fh} qq{\tselect BR2_PACKAGE_${brdep} # runtime};
746 say {$fh} qq{\thelp};
747 say {$fh} qq{\t ${abstract}\n} if $abstract;
748 say {$fh} qq{\t ${homepage}};
749 if ($need_dlopen{$distname}) {
750 say {$fh} qq{\ncomment "${fsname} needs a toolchain w/ dynamic library"};
751 say {$fh} qq{\tdepends on BR2_STATIC_LIBS};
755 if ($force || !-f $mkname) {
756 my $version = $dist->{version};
757 my ($path) = $dist->{download_url} =~ m|^[^:/?#]+://[^/?#]*([^?#]*)|;
758 # this URL contains only the scheme, auth and path parts (but no query and fragment parts)
759 # the scheme is not used, because the job is done by the BR download infrastructure
760 # the auth part is not used, because we use $(BR2_CPAN_MIRROR)
761 my ($filename, $directories, $suffix) = fileparse( $path, q{tar.gz}, q{tgz} );
762 $directories =~ s|/$||;
763 my @dependencies = map( { q{host-} . fsname( $_ ); } sort @{$deps_build{$distname}} );
764 my $dependencies = join qq{ \\\n\t}, @dependencies;
765 $dependencies = qq{\\\n\t} . $dependencies if scalar @dependencies > 1;
766 my @host_dependencies = map { q{host-} . fsname( $_ ); } sort( @{$deps_build{$distname}},
767 @{$deps_runtime{$distname}} );
768 my $host_dependencies = join qq{ \\\n\t}, @host_dependencies;
769 $host_dependencies = qq{\\\n\t} . $host_dependencies if scalar @host_dependencies > 1;
770 my $license = brlicense( ref $dist->{license} eq 'ARRAY'
771 ? join q{ or }, @{$dist->{license}}
772 : $dist->{license} );
773 my $license_files = join q{ }, sort keys %{$license_files{$distname}};
774 if ($license_files && (!$license || $license eq q{unknown})) {
775 push @info, qq{[$distname] undefined LICENSE, see $license_files};
778 say qq{write ${mkname}} unless $quiet;
779 open my $fh, q{>}, $mkname;
780 say {$fh} qq{################################################################################};
782 say {$fh} qq{# ${fsname}};
784 say {$fh} qq{################################################################################};
786 say {$fh} qq{${brname}_VERSION = ${version}};
787 say {$fh} qq{${brname}_SOURCE = ${distname}-\$(${brname}_VERSION).${suffix}};
788 say {$fh} qq{${brname}_SITE = \$(BR2_CPAN_MIRROR)${directories}};
789 say {$fh} qq{${brname}_DEPENDENCIES = ${dependencies}} if $need_target{$distname} && $dependencies;
790 say {$fh} qq{HOST_${brname}_DEPENDENCIES = ${host_dependencies}} if $need_host{$distname} && $host_dependencies;
791 say {$fh} qq{${brname}_LICENSE = ${license}} if $license;
792 say {$fh} qq{${brname}_LICENSE_FILES = ${license_files}} if $license_files;
793 say {$fh} qq{${brname}_DISTNAME = ${distname}};
795 say {$fh} qq{\$(eval \$(perl-package))} if $need_target{$distname};
796 say {$fh} qq{\$(eval \$(host-perl-package))} if $need_host{$distname};
799 if ($force || !-f $hashname) {
800 my ($checksum, $filename) = get_checksum($dist->{download_url});
801 my $md5 = $checksum->{md5};
802 my $sha256 = $checksum->{sha256};
803 say qq{write ${hashname}} unless $quiet;
804 open my $fh, q{>}, $hashname;
805 say {$fh} qq{# retrieved by scancpan from ${mirror}/};
806 say {$fh} qq{md5 ${md5} ${filename}};
807 say {$fh} qq{sha256 ${sha256} ${filename}};
808 my %license_files = %{$license_files{$distname}};
809 if (scalar keys %license_files) {
811 say {$fh} qq{# computed by scancpan};
812 foreach my $license (sort keys %license_files) {
813 my $digest = $license_files{$license};
814 say {$fh} qq{sha256 ${digest} ${license}};
819 if (want_test( $distname ) && ($force || !-f $testname)) {
820 my $classname = $distname;
821 $classname =~ s|-||g;
822 my $modname = $distname;
823 $modname =~ s|-|::|g;
824 my $mark = $is_xs{$distname} ? q{ XS} : q{};
825 my @indirect = (get_indirect_dependencies( $distname ));
826 say qq{write ${testname}} unless $quiet;
827 make_path $testdir unless -d $testdir;
828 open my $fh, q{>}, $testname;
829 say {$fh} qq{from tests.package.test_perl import TestPerlBase};
832 say {$fh} qq{class TestPerl${classname}(TestPerlBase):};
834 say {$fh} qq{ package:};
835 say {$fh} qq{ ${distname}${mark}};
836 say {$fh} qq{ direct dependencies:};
837 foreach my $dep (sort @{$deps_runtime{$distname}}) {
838 $mark = $is_xs{$dep} ? q{ XS} : q{};
839 say {$fh} qq{ ${dep}${mark}};
841 if (scalar @indirect > 0) {
842 say {$fh} qq{ indirect dependencies:};
843 foreach my $dep (sort @indirect) {
844 $mark = $is_xs{$dep} ? q{ XS} : q{};
845 say {$fh} qq{ ${dep}${mark}};
850 say {$fh} qq{ config = TestPerlBase.config + \\};
852 say {$fh} qq{ BR2_PACKAGE_PERL=y};
853 say {$fh} qq{ BR2_PACKAGE_${brname}=y};
856 say {$fh} qq{ def test_run(self):};
857 say {$fh} qq{ self.login()};
858 foreach my $dep (sort grep { $is_xs{$_} } @indirect) {
860 say {$fh} qq{ self.module_test("${dep}")};
862 foreach my $dep (sort grep { $is_xs{$_} } @{$deps_runtime{$distname}}) {
864 say {$fh} qq{ self.module_test("${dep}")};
866 say {$fh} qq{ self.module_test("${modname}")};
873 my $cfgname = q{package/Config.in};
875 open my $fh, q{<}, $cfgname;
878 $pkg{$_} = 1 if m|package/perl-|;
883 foreach my $distname (keys %need_target) {
884 my $fsname = fsname( $distname );
885 $pkg{qq{\tsource "package/${fsname}/Config.in"}} = 1;
888 say qq{${cfgname} must contain the following lines:};
889 say join qq{\n}, sort keys %pkg;
892 say join qq{\n}, @info;
898 utils/scancpan Try-Tiny Moo
902 utils/scancpan [options] [distname ...]
920 Prints a brief help message and exits.
924 Prints the manual page and exits.
928 Executes without output
932 Forces the overwriting of existing files.
934 =item B<-target/-notarget>
936 Switches package generation for the target variant (the default is C<-target>).
938 =item B<-host/-nohost>
940 Switches package generation for the host variant (the default is C<-nohost>).
944 Adds I<recommended> dependencies.
948 Adds dependencies for test.
954 This script creates templates of the Buildroot package files for all the
955 Perl/CPAN distributions required by the specified distnames. The
956 dependencies and metadata are fetched from https://metacpan.org/.
958 After running this script, it is necessary to check the generated files.
959 For distributions that link against a target library, you have to add the
960 buildroot package name for that library to the DEPENDENCIES variable.
962 See the Buildroot documentation for details on the usage of the Perl
965 The major version of the host perl must be aligned on the target one,
966 in order to work with the right CoreList data.
972 This program is free software; you can redistribute it and/or modify
973 it under the terms of the GNU General Public License as published by
974 the Free Software Foundation; either version 2 of the License, or
975 (at your option) any later version.
977 This program is distributed in the hope that it will be useful,
978 but WITHOUT ANY WARRANTY; without even the implied warranty of
979 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
980 General Public License for more details.
982 You should have received a copy of the GNU General Public License
983 along with this program; if not, write to the Free Software
984 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
986 This script is a part of Buildroot.
988 This script requires the module C<MetaCPAN::API::Tiny> (version 1.131730)
989 which was included at the beginning of this file by the tool C<fatpack>.
991 See L<https://metacpan.org/release/NPEREZ/MetaCPAN-API-Tiny-1.131730>.
993 See L<https://metacpan.org/release/App-FatPacker>.
995 These both libraries are free software and may be distributed under the same
996 terms as perl itself.
998 And perl may be distributed under the terms of Artistic v1 or GPL v1 license.