scancpan: wrap abstract if too long

[note: code style fixed]

Signed-off-by: Christopher McCrory <chrismcc@gmail.com>
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
Francois Perrad 2018-10-10 08:46:09 +02:00 committed by Thomas Petazzoni
parent e1f9882088
commit 228b6b680a

View File

@ -484,6 +484,8 @@ use HTTP::Tiny;
use Safe; use Safe;
use MetaCPAN::API::Tiny; use MetaCPAN::API::Tiny;
use Digest::SHA qw(sha256_hex); use Digest::SHA qw(sha256_hex);
use Text::Wrap;
$Text::Wrap::columns = 62;
# Below, 5.026 should be aligned with the version of perl actually # Below, 5.026 should be aligned with the version of perl actually
# bundled in Buildroot: # bundled in Buildroot:
@ -686,7 +688,7 @@ while (my ($distname, $dist) = each %dist) {
my $brname = brname( $fsname ); my $brname = brname( $fsname );
mkdir $dirname unless -d $dirname; mkdir $dirname unless -d $dirname;
if ($need_target{$distname} && ($force || !-f $cfgname)) { if ($need_target{$distname} && ($force || !-f $cfgname)) {
my $abstract = $dist->{abstract}; my $abstract = wrap( q{}, qq{\t }, $dist->{abstract} );
my $homepage = $dist->{resources}->{homepage} || qq{https://metacpan.org/release/${distname}}; my $homepage = $dist->{resources}->{homepage} || qq{https://metacpan.org/release/${distname}};
say qq{write ${cfgname}} unless $quiet; say qq{write ${cfgname}} unless $quiet;
open my $fh, q{>}, $cfgname; open my $fh, q{>}, $cfgname;