]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1308949 - Keep MYMETA.json up-to-date when checksetup is run
authorDylan William Hardison <dylan@hardison.net>
Fri, 14 Oct 2016 22:13:29 +0000 (18:13 -0400)
committerDylan William Hardison <dylan@hardison.net>
Fri, 14 Oct 2016 22:13:29 +0000 (18:13 -0400)
Makefile.PL
checksetup.pl

index a84aa1cdf58fce9bff60b92934bf6ce04629a369..1bee517c8175cc2a2301eb65207e0691b2a09d8a 100644 (file)
@@ -22,6 +22,13 @@ use constant BUGZILLA_VERSION => $ENV{BUGZILLA_VERSION} // 42;
 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
index e5df8c5c8446c19de209129d51de2d29141816cb..327de3c566361da8f53b075fe17829d289e59ca0 100755 (executable)
@@ -88,7 +88,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};