Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DISTVNAME warnings more cleanly #457

Merged
merged 2 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/ExtUtils/MM_Any.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@ sub metafile_data {
$meta_merge ||= {};

my $version = _normalize_version($self->{VERSION});
my $unstable = $version =~ /_/ || ( defined $self->{DISTVNAME} and $self->{DISTVNAME} =~ /-TRIAL\d*$/ );
my $unstable = $version =~ /_/ || $self->{DISTVNAME} =~ /-TRIAL\d*$/;
my $release_status = $unstable ? 'unstable' : 'stable';
my %meta = (
# required
Expand Down
16 changes: 9 additions & 7 deletions t/meta_convert.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,33 @@ chdir $tmpdir or die "chdir $tmpdir: $!";
my $EMPTY = qr/['"]?version['"]?\s*:\s*['"]['"]/;
my @DATA = (
[
[ DISTNAME => 'Net::FTP::Recursive', VERSION => 'Recursive.pm', ],
[ DISTNAME => 'Net-FTP-Recursive', VERSION => 'Recursive.pm', ],
qr{Can't parse version 'Recursive.pm'},
'VERSION => filename',
$EMPTY,
],
[
[ DISTNAME => 'Image::Imgur', VERSION => 'undef', ],
[ DISTNAME => 'Image-Imgur', VERSION => 'undef', ],
qr{Can't parse version 'undef'},
'no $VERSION in file -> VERSION=>"undef"',
$EMPTY,
],
[
[ DISTNAME => 'SQL::Library', VERSION => 0.0.3, ],
[ DISTNAME => 'SQL-Library', VERSION => 0.0.3, ],
qr{Can't parse version '\x00\x00\x03'},
"x.y.z version",
$EMPTY,
],
[
[ DISTNAME => 'Array::Suffix', VERSION => '.5', ],
[ DISTNAME => 'Array-Suffix', VERSION => '.5', ],
qr{Can't parse version '.5'},
".5 version",
$EMPTY,
],
[
[
DISTNAME => 'Attribute::Signature',
DISTNAME => 'Attribute-Signature',
DISTVNAME => 'Attribute-Signature-1.23.tar.gz',
META_MERGE => {
resources => {
repository => 'http://github.com/chorny/Attribute-Signature',
Expand All @@ -55,7 +56,8 @@ my @DATA = (
],
[
[
DISTNAME => 'CPAN::Testers::ParseReport',
DISTNAME => 'CPAN-Testers-ParseReport',
DISTVNAME => 'CPAN-Testers-ParseReport-2.34.tar.gz',
VERSION => '2.34',
META_ADD => {
provides => {
Expand All @@ -72,7 +74,7 @@ my @DATA = (
],
[
[
DISTNAME => 'Bad::License',
DISTNAME => 'Bad-License',
VERSION => '2.34',
LICENSE => 'death and retribution',
],
Expand Down
6 changes: 4 additions & 2 deletions t/metafile_data.t
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ sub mymeta_ok {
}

my $new_mm = sub {
return bless { ARGS => {@_}, @_ }, 'ExtUtils::MM_Any';
my %args = @_;
$args{DISTVNAME} ||= "$args{DISTNAME}-$args{VERSION}.tar.gz";
return bless { ARGS => \%args, %args }, 'ExtUtils::MM_Any';
};
my @METASPEC14 = (
'meta-spec' => {
Expand Down Expand Up @@ -456,7 +458,7 @@ my @GENERIC_OUT = (
note "CPAN::Meta bug using the module version instead of the meta spec version";
{
my $mm = $new_mm->(
NAME => 'GD::Barcode::Code93',
DISTNAME => 'GD-Barcode-Code93',
AUTHOR => 'Chris DiMartino',
ABSTRACT => 'Code 93 implementation of GD::Barcode family',
PREREQ_PM => {
Expand Down
Loading