<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package CPANPLUS::Internals::Constants::Report;

use strict;
use CPANPLUS::Error;

use File::Spec;
use Locale::Maketext::Simple    Class =&gt; 'CPANPLUS', Style =&gt; 'gettext';

require Exporter;
use vars    qw[$VERSION @ISA @EXPORT];

use Package::Constants;

### for the version
require CPANPLUS::Internals;

$VERSION    = $CPANPLUS::Internals::VERSION = $CPANPLUS::Internals::VERSION;
@ISA        = qw[Exporter];
@EXPORT     = Package::Constants-&gt;list( __PACKAGE__ );


### OS to regex map ###
my %OS = (
    Amiga       =&gt; 'amigaos',
    Atari       =&gt; 'mint',
    BSD         =&gt; 'bsdos|darwin|freebsd|openbsd|netbsd',
    Be          =&gt; 'beos',
    BeOS        =&gt; 'beos',
    Cygwin      =&gt; 'cygwin',
    Darwin      =&gt; 'darwin',
    EBCDIC      =&gt; 'os390|os400|posix-bc|vmesa',
    HPUX        =&gt; 'hpux',
    Linux       =&gt; 'linux',
    MSDOS       =&gt; 'dos|os2|MSWin32|cygwin',
    'bin\\d*Mac'=&gt; 'MacOS|darwin', # binMac, bin56Mac, bin58Mac...
    Mac         =&gt; 'MacOS|darwin',
    MacPerl     =&gt; 'MacOS',
    MacOS       =&gt; 'MacOS|darwin',
    MacOSX      =&gt; 'darwin',
    MPE         =&gt; 'mpeix',
    MPEiX       =&gt; 'mpeix',
    OS2         =&gt; 'os2',
    Plan9       =&gt; 'plan9',
    RISCOS      =&gt; 'riscos',
    SGI         =&gt; 'irix',
    Solaris     =&gt; 'solaris',
    Unix        =&gt; 'aix|bsdos|darwin|dgux|dynixptx|freebsd|'.
                   'linux|hpux|machten|netbsd|next|openbsd|dec_osf|'.
                   'svr4|sco_sv|unicos|unicosmk|solaris|sunos',
    VMS         =&gt; 'VMS',
    VOS         =&gt; 'VOS',
    Win32       =&gt; 'MSWin32|cygwin',
    Win32API    =&gt; 'MSWin32|cygwin',
);

use constant GRADE_FAIL     =&gt; 'fail';
use constant GRADE_PASS     =&gt; 'pass';
use constant GRADE_NA       =&gt; 'na';
use constant GRADE_UNKNOWN  =&gt; 'unknown';

use constant MAX_REPORT_SEND
                            =&gt; 2;

use constant CPAN_TESTERS_EMAIL
                            =&gt; 'cpan-testers@perl.org';

### the cpan mail account for this user ###
use constant CPAN_MAIL_ACCOUNT
                            =&gt; sub {
                                my $username = shift or return;
                                return $username . '@cpan.org';
                            };

### check if this module is platform specific and if we're on that
### specific platform. Alternately, the module is not platform specific
### and we're always OK to send out test results.
use constant RELEVANT_TEST_RESULT
                            =&gt; sub {
                                my $mod  = shift or return;
                                my $name = $mod-&gt;module;
                                my $specific;
                                for my $platform (keys %OS) {
                                    if( $name =~ /^$platform\b/i ) {
                                        # beware the Mac != MAC
                                        next if($platform eq 'Mac' &amp;&amp;
                                                $name !~ /^$platform\b/);
                                        $specific++;
                                        return 1 if
                                            $^O =~ /^(?:$OS{$platform})$/
                                    }
                                };
                                return $specific ? 0 : 1;
                            };

use constant UNSUPPORTED_OS
                            =&gt; sub {
                                my $buffer = shift or return;
                                if( $buffer =~
                                        /No support for OS|OS unsupported/im ) {
                                    return 1;
                                }
                                return 0;
                          };

use constant PERL_VERSION_TOO_LOW
                            =&gt; sub {
                                my $buffer = shift or return;
                                # ExtUtils::MakeMaker format
                                if( $buffer =~
                                        /Perl .*? required--this is only .*?/m ) {
                                    return 1;
                                }
                                # Module::Build format
                                if( $buffer =~
                                        /ERROR:( perl:)? Version .*?( of perl)? is installed, but we need version &gt;= .*?/m ) {
                                    return 1;
                                }
                                return 0;
                          };

use constant NO_TESTS_DEFINED
                            =&gt; sub {
                                my $buffer = shift or return;
                                if( $buffer =~
                                  /(No tests defined( for [\w:]+ extension)?\.)/
                                  and $buffer !~ /\*\.t/m and
                                      $buffer !~ /test\.pl/m
                                ) {
                                    return $1
                                }

                                return;
                            };

### what stage did the test fail? ###
use constant TEST_FAIL_STAGE
                            =&gt; sub {
                                my $buffer = shift or return;
                                return $buffer =~ /(MAKE [A-Z]+).*/
                                    ? lc $1 :
                                    'fetch';
                            };


use constant MISSING_PREREQS_LIST
                            =&gt; sub {
                                my $buffer = shift;
                                my $last = ( split /\[ERROR\] .+? MAKE TEST/, $buffer )[-1];
                                my @list = map { s/.pm$//; s|/|::|g; $_ }
                                    ($last =~
                                        m/\bCan\'t locate (\S+) in \@INC/g);

                                ### make sure every missing prereq is only
                                ### listed once
                                {   my %seen;
                                    @list = grep { !$seen{$_}++ } @list
                                }

                                return @list;
                            };

use constant MISSING_EXTLIBS_LIST
                            =&gt; sub {
                                my $buffer = shift;
                                my @list =
                                    ($buffer =~
                                        m/No library found for -l([-\w]+)/g);

                                return @list;
                            };

use constant REPORT_MESSAGE_HEADER
                            =&gt; sub {
                                my ($version, $author) = @_;
                                return &lt;&lt; ".";

Dear $author,

This is a computer-generated error report created automatically by
CPANPLUS, version $version. Testers personal comments may appear
at the end of this report.

.
                            };

use constant REPORT_MESSAGE_FAIL_HEADER
                            =&gt; sub {
                                my($stage, $buffer) = @_;
                                return &lt;&lt; ".";

Thank you for uploading your work to CPAN.  However, it appears that
there were some problems testing your distribution.

TEST RESULTS:

Below is the error stack from stage '$stage':

$buffer

.
                            };

use constant REPORT_MESSAGE_PASS_HEADER
                            =&gt; sub {
                                my($stage, $buffer) = @_;
                                return &lt;&lt; ".";

Thank you for uploading your work to CPAN.  Congratulations!
All tests were successful.

TEST RESULTS:

Below is the error stack from stage '$stage':

$buffer

.
                            };

use constant REPORT_MISSING_PREREQS
                            =&gt; sub {
                                my ($author,$email,@missing) = @_;
                                $author = ($author &amp;&amp; $email)
                                            ? "$author ($email)"
                                            : 'Your Name Here';

                                my $modules = join "\n", @missing;
                                my $prereqs = join "\n",
                                    map {"\t'$_'\t=&gt; '0',".
                                         " # or a minimum working version"}
                                    @missing;

                                return &lt;&lt; ".";

MISSING PREREQUISITES:

It was observed that the test suite seem to fail without these modules:

$modules

As such, adding the prerequisite module(s) to 'PREREQ_PM' in your
Makefile.PL should solve this problem.  For example:

WriteMakefile(
    AUTHOR      =&gt; '$author',
    ... # other information
    PREREQ_PM   =&gt; {
$prereqs
    }
);

Thanks! :-)

.
                            };

use constant REPORT_MISSING_TESTS
                            =&gt; sub {
                                return &lt;&lt; ".";
RECOMMENDATIONS:

It would be very helpful if you could include even a simple test
script in the next release, so people can verify which platforms
can successfully install them, as well as avoid regression bugs?

A simple 't/use.t' that says:

#!/usr/bin/env perl -w
use strict;
use Test;
BEGIN { plan tests =&gt; 1 }

use Your::Module::Here; ok(1);
exit;
__END__

would be appreciated.  If you are interested in making a more robust
test suite, please see the Test::Simple, Test::More and Test::Tutorial
documentation at &lt;http://search.cpan.org/dist/Test-Simple/&gt;.

Thanks!  :-)

.
                            };

use constant REPORT_LOADED_PREREQS
                            =&gt; sub {
                                my $mod = shift;
                                my $cb  = $mod-&gt;parent;
                                my $prq = $mod-&gt;status-&gt;prereqs || {};

                                ### not every prereq may be coming from CPAN
                                ### so maybe we wont find it in our module
                                ### tree at all...
                                ### skip ones that cant be found in teh list
                                ### as reported in #12723
                                my @prq = grep { defined }
                                          map { $cb-&gt;module_tree($_) }
                                          sort keys %$prq;

                                ### no prereqs?
                                return '' unless @prq;

                                ### some apparently, list what we loaded
                                my $str = &lt;&lt; ".";
PREREQUISITES:

Here is a list of prerequisites you specified and versions we
managed to load:

.
                                $str .= join '',
                                        map { sprintf "\t%s %-30s %8s %8s\n",
                                              @$_

                                        } [' ', 'Module Name', 'Have', 'Want'],
                                          map { my $want = $prq-&gt;{$_-&gt;name};
                                              [ do { $_-&gt;is_uptodate(
                                                    version =&gt; $want
                                                   ) ? ' ' : '!'
                                                },
                                                $_-&gt;name,
                                                $_-&gt;installed_version,
                                                $want
                                              ],
                                        ### might be empty entries in there
                                        } grep { $_ } @prq;

                                return $str;
                            };

use constant REPORT_TOOLCHAIN_VERSIONS
                            =&gt; sub {
                                my $mod = shift;
                                my $cb  = $mod-&gt;parent;
                                #die unless $cb-&gt;isa('CPANPLUS::Backend');

                                my @toolchain_modules= qw(
                                    CPANPLUS
                                    CPANPLUS::Dist::Build
                                    Cwd
                                    ExtUtils::CBuilder
                                    ExtUtils::Command
                                    ExtUtils::Install
                                    ExtUtils::MakeMaker
                                    ExtUtils::Manifest
                                    ExtUtils::ParseXS
                                    File::Spec
                                    Module::Build
                                    Test::Harness
                                    Test::More
                                    version
                                );

                                my @toolchain =
                                          grep { $_ } #module_tree returns '' when module is not found
                                          map { $cb-&gt;module_tree($_) }
                                          sort @toolchain_modules;

                                ### no prereqs?
                                return '' unless @toolchain;

                                ### toolchain modules
                                my $str = &lt;&lt; ".";

Perl module toolchain versions installed:
.
                                $str .= join '',
                                        map { sprintf "\t%-30s %8s\n",
                                              @$_

                                        } ['Module Name', 'Have'],
                                          map {
                                              [ $_-&gt;name,
                                                $_-&gt;installed_version,
                                              ],
                                        ### might be empty entries in there
                                        } @toolchain;

                                return $str;
                            };


use constant REPORT_TESTS_SKIPPED
                            =&gt; sub {
                                return &lt;&lt; ".";

******************************** NOTE ********************************
***                                                                ***
***    The tests for this module were skipped during this build    ***
***                                                                ***
**********************************************************************

.
                            };

use constant REPORT_MESSAGE_FOOTER
                            =&gt; sub {
                                return &lt;&lt; ".";

******************************** NOTE ********************************
The comments above are created mechanically, possibly without manual
checking by the sender.  As there are many people performing automatic
tests on each upload to CPAN, it is likely that you will receive
identical messages about the same problem.

If you believe that the message is mistaken, please reply to the first
one with correction and/or additional informations, and do not take
it personally.  We appreciate your patience. :)
**********************************************************************

Additional comments:

.
                             };

1;

# Local variables:
# c-indentation-style: bsd
# c-basic-offset: 4
# indent-tabs-mode: nil
# End:
# vim: expandtab shiftwidth=4:
</pre></body></html>