summaryrefslogtreecommitdiffstats
path: root/gen-cpanfile.pl
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2016-09-12 22:22:17 +0200
committerDylan William Hardison <dylan@hardison.net>2016-09-12 22:22:17 +0200
commit14bcdce1dc6029c3676c3640d8148c83c14692e5 (patch)
tree99d760e13b687f8111635916d9ed3937bc084c64 /gen-cpanfile.pl
parente6bf4cacb10f86077fe898349485f5c7ab9fb4b6 (diff)
downloadbugzilla-14bcdce1dc6029c3676c3640d8148c83c14692e5.tar.gz
bugzilla-14bcdce1dc6029c3676c3640d8148c83c14692e5.tar.xz
Revert "Bug 1283930 - Add Makefile.PL & local/lib/perl5 support to bmo/master + local symlink to data/ directory"
Diffstat (limited to 'gen-cpanfile.pl')
-rwxr-xr-xgen-cpanfile.pl68
1 files changed, 0 insertions, 68 deletions
diff --git a/gen-cpanfile.pl b/gen-cpanfile.pl
deleted file mode 100755
index be07259d1..000000000
--- a/gen-cpanfile.pl
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/usr/bin/perl
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This Source Code Form is "Incompatible With Secondary Licenses", as
-# defined by the Mozilla Public License, v. 2.0.
-
-# This file has detailed POD docs, do "perldoc checksetup.pl" to see them.
-
-######################################################################
-# Initialization
-######################################################################
-
-use 5.10.1;
-use strict;
-use warnings;
-
-use lib qw(. lib local/lib/perl5);
-
-use Getopt::Long qw(:config gnu_getopt);
-
-if (-f "MYMETA.json") {
- eval {
- require CPAN::Meta;
- require Module::CPANfile;
-
- my (@with_feature, @without_feature);
- my $with_all_features = 0;
- GetOptions(
- 'with-all-features|A!' => \$with_all_features,
- 'with-feature|D=s@' => \@with_feature,
- 'without-feature|U=s@' => \@without_feature
- );
-
-
- my $meta = CPAN::Meta->load_file("MYMETA.json");
-
- my @phases = qw(configure build test develop runtime);
- my @types = qw(requires recommends suggests conflicts);
-
- my %features;
- if ($with_all_features) {
- $features{$_->identifier} = 1 foreach ($meta->features);
- }
- $features{$_} = 1 foreach @with_feature;
- $features{$_} = 0 foreach @without_feature;
- my @features = grep { $features{$_} } keys %features;
-
- my $prereqs = $meta->effective_prereqs(\@features)->as_string_hash;
- my $filtered = {};
-
- while (my($phase, $types) = each %$prereqs) {
- while (my($type, $reqs) = each %$types) {
- $filtered->{$phase}{$type} = $reqs;
- }
- }
-
- my $cpanfile = Module::CPANfile->from_prereqs($filtered);
- open my $cpanfile_fh, '>', 'cpanfile' or die "cannot write to cpanfile: $!";
- print $cpanfile_fh $cpanfile->to_string();
- close $cpanfile_fh;
- };
- die "Unable generate cpanfile: $@\n" if $@;
-}
-else {
- die "MYMETA.yml is missing, cannot generate cpanfile\n";
-}