diff options
author | Dylan William Hardison <dylan@hardison.net> | 2017-03-27 15:56:14 +0200 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2017-03-27 17:18:19 +0200 |
commit | 15daaf123635c1e734dfe6e3aed60f52df0364ce (patch) | |
tree | c4823e177859f5b69a68017635bbd29491ceec90 /checksetup.pl | |
parent | 08c0187b591bb1bb4248382a8106a450c9b359e3 (diff) | |
download | bugzilla-15daaf123635c1e734dfe6e3aed60f52df0364ce.tar.gz bugzilla-15daaf123635c1e734dfe6e3aed60f52df0364ce.tar.xz |
Bug 1350466 - Uplift bug 1342832 to bmo for performance and other reasons
Diffstat (limited to 'checksetup.pl')
-rwxr-xr-x | checksetup.pl | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/checksetup.pl b/checksetup.pl index 327de3c56..598432c93 100755 --- a/checksetup.pl +++ b/checksetup.pl @@ -17,11 +17,13 @@ use strict; use warnings; use File::Basename; -BEGIN { chdir dirname($0); } -use lib qw(. lib local/lib/perl5 .checksetup_lib/lib/perl5); - -# the @INC which checksetup needs to operate against. -our @BUGZILLA_INC = grep { !/checksetup_lib/ } @INC; +use File::Spec; +BEGIN { + require lib; + my $dir = File::Spec->rel2abs(dirname(__FILE__)); + lib->import($dir, File::Spec->catdir($dir, "lib"), File::Spec->catdir($dir, qw(local lib perl5))); + chdir($dir); +} use Getopt::Long qw(:config bundling); use Pod::Usage; @@ -92,18 +94,21 @@ $ENV{PERL_MM_USE_DEFAULT} = 1; $ENV{BZ_SILENT_MAKEFILE} = 1; system($^X, "Makefile.PL"); -my $meta = load_cpan_meta(); +if (! -f "MYMETA.json") { + die "Makefile.PL failed to generate a MYMETA.json file.", + "Try upgrading ExtUtils::MakeMaker"; +} +require Bugzilla::CPAN; + +my $meta = Bugzilla::CPAN->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(); + die "Your version of ExtUtils::MakeMaker is too old or broken\n"; } -my $requirements = check_cpan_requirements($meta, \@BUGZILLA_INC, !$silent); +my $requirements = check_cpan_requirements($meta, [@INC], !$silent); exit 1 unless $requirements->{ok}; -check_all_cpan_features($meta, \@BUGZILLA_INC, !$silent); +check_all_cpan_features($meta, [@INC], !$silent); exit 0 if $switch{'check-modules'}; ########################################################################### |