Bug#664150: dh-make-perl: Fails to parse "perl_5" in META.json as a license
Per Carlson
pelle at hemmop.com
Fri Mar 16 11:01:28 UTC 2012
> Seems like it stumbles over the array;
> print "META says: ", Dumper $self->meta->{license};
> outputs:
>
> META says: $VAR1 = [
> 'perl_5'
> ];
>
>
> Changing
>
> if ( $self->meta->{license} and $self->meta->{license} =~ /perl/i
>
> to
>
> if ( $self->meta->{license} and $self->meta->{license} ~~ /perl/i
>
> works in this case (lib/DhMakePerl/Command/Packaging.pm, line 1065).
>
> Not sure about any side effects, in theory it should work for both
> scalars and arrays, and smart matching exists since 5.10 ...
It stumbles on other licenses as well. According to CPAN::Meta:Spec
the licenses attribute is always an array, and might contain more than
one license:
license
Example:
license => [ 'perl_5' ]
license => [ 'apache_2', 'mozilla_1_0' ]
(Spec 2) [required] {List of one or more License Strings}
I've attached a patch to treat $self->meta->{license} as an ARRAY and
loop over it. While on it, I did also add support for some other
licenses as well (beyond 'perl').
--
Pelle
"D’ä e å, vett ja”, skrek ja, för ja ble rasen,
”å i åa ä e ö, hörer han lite, d’ä e å, å i åa ä e ö"
- Gustav Fröding, 1895
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-License-attribute-from-META-file-is-array.patch
Type: text/x-patch
Size: 2130 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/attachments/20120316/68c890ce/attachment.bin>
More information about the pkg-perl-maintainers
mailing list