[Buildroot] [pkg-perl infra V7 2/6] scancpan: a new script

Thomas De Schampheleire patrickdepinguin at gmail.com
Tue Feb 11 11:56:43 UTC 2014


Hi Francois,

On Tue, Feb 11, 2014 at 11:56 AM, Francois Perrad <fperrad at gmail.com> wrote:
> which creates Perl/CPAN package files
>
> The 2 dependencies will be installed by the Perl infrastructure.
>
> Signed-off-by: Francois Perrad <francois.perrad at gadz.org>
> ---
[..]
> diff --git a/support/scripts/scancpan b/support/scripts/scancpan
> new file mode 100755
> index 0000000..63a8885
> --- /dev/null
> +++ b/support/scripts/scancpan
[..]
> +
> +my %pkg;
> +my $cfgname = q{package/Config.in};
> +if (-f $cfgname) {
> +    open my $fh, q{<}, $cfgname;
> +    while (<$fh>) {
> +        chomp;
> +        $pkg{$_} = 1 if m|package/perl-|;
> +    }
> +    close $fh;
> +}
> +
> +foreach my $distname (sort keys %dist) {
> +    my $fsname = fsname( $distname );
> +    $pkg{qq{source "package/${fsname}/Config.in"}} = 1;
> +}
> +
> +say qq{${cfgname} must contains the following lines:};

must contain

> +say join qq{\n}, sort keys %pkg;
> +
> +__END__
> +
> +=head1 NAME
> +
> +support/scripts/scancpan Try-Tiny Moo
> +
> +=head1 SYNOPSIS
> +
> +make host-perl-metacpan-api-tiny host-perl-module-corelist # install dependencies
> +
> +export PERL5LIB=$(HOST_DIR)/usr/lib/perl5 # allows to find dependencies
> +supports/scripts/scancpan [options] [distname ...]
> +
> + Options:
> +   -help
> +   -man
> +   -quiet
> +   -force
> +   -recommend
> +
> +=head1 OPTIONS
> +
> +=over 8
> +
> +=item B<-help>
> +
> +Print a brief help message and exits.

Prints

> +
> +=item B<-man>
> +
> +Prints the manual page and exits.
> +
> +=item B<-quiet>
> +
> +Executes without output
> +
> +=item B<-force>
> +
> +Forces the overwritting of existing files.

overwriting

> +
> +=item B<-recommend>
> +
> +Adds I<recommended> dependencies.
> +
> +=back
> +
> +=head1 DESCRIPTION
> +
> +This script creates the BR package files for all Perl/CPAN

I would write 'buildroot' instead of BR

> +distributions required by all distname. These data are fetched from

To me this sentence sounds odd: "This script creates the buildroot
package files for all Perl/CPAN distributions required by all
distname." The 'distname' is the package(s) that the user supplies as
argument to the script. But what are these 'distributions' you
mention?
Also, 'by all distname' should either be 'by all distnames' but maybe
better: 'by all specified packages'.

Best regards,
Thomas



More information about the buildroot mailing list