Commit d1e7da3b authored by Dylan Hardison's avatar Dylan Hardison Committed by Dylan William Hardison

Bug 1308949 - Keep MYMETA.json up-to-date when checksetup is run

r=dkl
parent d943c464
=head1 NAME
JSON::PP::Boolean - dummy module providing JSON::PP::Boolean
=head1 SYNOPSIS
# do not "use" yourself
=head1 DESCRIPTION
This module exists only to provide overload resolution for Storable and similar modules. See
L<JSON::PP> for more info about this class.
=cut
use JSON::PP ();
use strict;
1;
=head1 AUTHOR
This idea is from L<JSON::XS::Boolean> written by Marc Lehmann <schmorp[at]schmorp.de>
=cut
......@@ -23,6 +23,13 @@ use Bugzilla::Constants qw(BUGZILLA_VERSION);
use File::Basename;
use File::Spec;
BEGIN {
if ($ENV{BZ_SILENT_MAKEFILE}) {
open STDOUT, '>>', File::Spec->devnull;
open STDERR, '>>', File::Spec->devnull;
}
}
# META.json and META.yml exist only for the benefit of older
# installs where cpanm can't get the optional features out of Makefile.PL
# Unfortunately having META.json and META.yml commited to the repo is weird
......@@ -369,7 +376,9 @@ cpanfile: MYMETA.json
\t\$(PERLRUN) gen-cpanfile.pl \$(GEN_CPANFILE_ARGS)
checksetup_lib: Makefile.PL
\tcpanm -l .checksetup_lib CPAN::Meta Module::Metadata\@$all_features{'Module::Metadata'}
\tcpanm -L .checksetup_lib --notest \\
CPAN::Meta JSON::PP CPAN::Meta::Requirements \\
Module::Metadata\@$all_features{'Module::Metadata'}
\t-rm -fr .checksetup_lib/man
\t-rm -fr .checksetup_lib/lib/perl5/*/.meta
\t-rm -fr .checksetup_lib/lib/perl5/Test
......
......@@ -91,7 +91,17 @@ if (defined $switch{cpanm}) {
exit 1 if $rv != 0;
}
$ENV{PERL_MM_USE_DEFAULT} = 1;
$ENV{BZ_SILENT_MAKEFILE} = 1;
system($^X, "Makefile.PL");
my $meta = load_cpan_meta();
if (keys %{$meta->{optional_features}} < 1) {
warn "Your version of ExtUtils::MakeMaker is probably too old\n";
warn "Falling back to static (and wrong) META.json\n";
unlink('MYMETA.json');
$meta = load_cpan_meta();
}
my $requirements = check_cpan_requirements($meta, \@BUGZILLA_INC, !$silent);
exit 1 unless $requirements->{ok};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment