summaryrefslogtreecommitdiffstats
path: root/gen-cpanfile.pl
diff options
context:
space:
mode:
authorPerl Tidy <perltidy@bugzilla.org>2018-12-05 21:38:52 +0100
committerDylan William Hardison <dylan@hardison.net>2018-12-05 23:49:08 +0100
commit8ec8da0491ad89604700b3e29a227966f6d84ba1 (patch)
tree9d270f173330ca19700e0ba9f2ee931300646de1 /gen-cpanfile.pl
parenta7bb5a65b71644d9efce5fed783ed545b9336548 (diff)
downloadbugzilla-8ec8da0491ad89604700b3e29a227966f6d84ba1.tar.gz
bugzilla-8ec8da0491ad89604700b3e29a227966f6d84ba1.tar.xz
no bug - reformat all the code using the new perltidy rules
Diffstat (limited to 'gen-cpanfile.pl')
-rwxr-xr-xgen-cpanfile.pl68
1 files changed, 34 insertions, 34 deletions
diff --git a/gen-cpanfile.pl b/gen-cpanfile.pl
index be07259d1..f773ddc99 100755
--- a/gen-cpanfile.pl
+++ b/gen-cpanfile.pl
@@ -21,48 +21,48 @@ 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;
+ 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 (@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 $meta = CPAN::Meta->load_file("MYMETA.json");
- my @phases = qw(configure build test develop runtime);
- my @types = qw(requires recommends suggests conflicts);
+ 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 %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 = {};
+ 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;
- }
- }
+ 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 $@;
+ 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";
+ die "MYMETA.yml is missing, cannot generate cpanfile\n";
}