diff options
author | Kenichi Ishigaki <ishigaki@cpan.org> | 2016-01-07 19:16:01 +0900 |
---|---|---|
committer | Kenichi Ishigaki <ishigaki@cpan.org> | 2016-01-07 19:16:01 +0900 |
commit | b4a1c17ca236009132c5cb4b9ac07c5c16dcbc6b (patch) | |
tree | 0ef3afcbfa8095ff70abcbdf470eb399f59b1274 /lib/Parse | |
parent | 9b7c462a0c04dbc65dab120a80e0a6c44d8b53e4 (diff) |
ported version_ok() implemented in PAUSE
Diffstat (limited to 'lib/Parse')
-rw-r--r-- | lib/Parse/PMFile.pm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Parse/PMFile.pm b/lib/Parse/PMFile.pm index b32647f..3e33a7e 100644 --- a/lib/Parse/PMFile.pm +++ b/lib/Parse/PMFile.pm @@ -144,12 +144,25 @@ sub parse { next; # don't screw up 02packages } } + unless ($self->_version_ok($pp)) { + $errors{$package} = { + long_version => qq{Version string exceeds maximum allowed length of 16b: "$pp->{version}"}, + infile => $pp->{infile}, + }; + next; + } $checked_in{$package} = $ppp->{$package}; } # end foreach package return (wantarray && %errors) ? (\%checked_in, \%errors) : \%checked_in; } +sub _version_ok { + my ($self, $pp) = @_; + return if length($pp->{version} || 0) > 16; + return 1 +} + sub _perm_check { my ($self, $package) = @_; my $userid = $self->{USERID}; |