new issue
[andk-cpan-tools.git] / bin / prereqcheck.pl
blobd49285a8fd8d4ea91f653d8908634344419d4813
1 #!/usr/bin/perl
3 # use 5.010;
4 use strict;
5 use warnings;
7 =head1 NAME
11 =head1 SYNOPSIS
13 prereqcheck.pl perlglob module need
15 =head1 OPTIONS
17 =over 8
19 =cut
21 my @opt = <<'=back' =~ /B<--(\S+)>/g;
23 =item B<--help|h!>
25 This help
27 =back
29 =head1 DESCRIPTION
31 Run what CPAN::Reporter runs when it checks the prerequisites with
32 loading one after the other in a separate process. At least the last
33 time I looked which was circa at CPAN::Reporter version 1.2004. After
34 that, Slaven discovered problematic cases which led to new releases.
36 =cut
39 use FindBin;
40 use lib "$FindBin::Bin/../lib";
41 BEGIN {
42 push @INC, qw( );
45 use Dumpvalue;
46 use File::Basename qw(dirname);
47 use File::Path qw(mkpath);
48 use File::Spec;
49 use File::Temp;
50 use Getopt::Long;
51 use Hash::Util qw(lock_keys);
53 our %Opt;
54 lock_keys %Opt, map { /([^=]+)/ } @opt;
55 GetOptions(\%Opt,
56 @opt,
57 ) or pod2usage(1);
59 my($perlglob,$mod,$v) = @ARGV;
60 unless (defined $v) {
61 pod2usage(1);
63 my @perls = glob $perlglob;
64 for my $perl (@perls) {
65 my $PC = `$perl -MCPAN::Reporter::PrereqCheck -le 'print \$INC{"CPAN/Reporter/PrereqCheck.pm"}'`;
66 chomp $PC;
67 # echo DB_File 0 | $yourperl $PC
68 warn "Doing the equivalent of:
69 echo $mod $v | $perl $PC
71 open my $fh, "|-", $perl, $PC or die "could not fork: $!";
72 print $fh "$mod $v\n";
73 close $fh or die "FAILED: $perl...: $!";
76 # Local Variables:
77 # mode: cperl
78 # cperl-indent-level: 4
79 # End: