~ubuntu-branches/ubuntu/wily/libcpan-reporter-perl/wily

« back to all changes in this revision

Viewing changes to lib/CPAN/Reporter.pm

  • Committer: Package Import Robot
  • Author(s): gregor herrmann, Salvatore Bonaccorso, gregor herrmann
  • Date: 2015-05-06 20:35:14 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20150506203514-mq0057vmynx5qhiv
Tags: 1.2014-1
* Team upload.

[ Salvatore Bonaccorso ]
* Update Vcs-Browser URL to cgit web frontend

[ gregor herrmann ]
* Add debian/upstream/metadata
* Import upstream version 1.2014
* Update filename in debian/libcpan-reporter-perl.docs.
* Declare compliance with Debian Policy 3.9.6.
* Add libmodule-build-perl to Build-Depend-Indep. Used in some tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
use strict;
2
2
package CPAN::Reporter;
3
 
our $VERSION = '1.2011'; # VERSION
 
3
 
 
4
our $VERSION = '1.2014';
4
5
 
5
6
use Config;
6
7
use Capture::Tiny qw/ capture tee_merged /;
522
523
    return;
523
524
}
524
525
 
 
526
sub _report_timeout {
 
527
    my $result = shift;
 
528
    if ($result->{exit_value} == 9) {
 
529
        my $config_obj = CPAN::Reporter::Config::_open_config_file();
 
530
        my $config;
 
531
        $config = CPAN::Reporter::Config::_get_config_options( $config_obj )
 
532
            if $config_obj;
 
533
 
 
534
        if ($config->{'_store_problems_in_dir'}) {
 
535
            my $distribution = $result->{dist}->base_id;
 
536
            my $file = "e9.$distribution.${\(time)}.$$.log";
 
537
            if (open my $to_log_fh, '>>', $config->{'_store_problems_in_dir'}.'/'.$file) {
 
538
                print $to_log_fh $distribution,"\n";
 
539
                print $to_log_fh "stage: ",$result->{phase},"\n";
 
540
                print $to_log_fh $Config{archname},"\n";
 
541
                print $to_log_fh _report_text( $result );
 
542
            } else {
 
543
                $CPAN::Frontend->mywarn( "CPAN::Reporter: writing ".
 
544
                    $config->{'_store_problems_in_dir'}.'/'.$file. " failed\n");
 
545
            }
 
546
        }
 
547
        if ($config->{'_problem_log'}) {
 
548
            my $distribution = $result->{dist}->base_id;
 
549
            if (open my $to_log_fh, '>>', $config->{'_problem_log'}) {
 
550
                print $to_log_fh "$result->{phase} $distribution $Config{archname}\n";
 
551
            } else {
 
552
                $CPAN::Frontend->mywarn( "CPAN::Reporter: writing ".
 
553
                    $config->{'_store_problems_in_dir'}. " failed\n");
 
554
            }
 
555
        }
 
556
    }
 
557
}
 
558
 
525
559
#--------------------------------------------------------------------------#
526
560
# _downgrade_known_causes
527
561
# Downgrade failure/unknown grade if we can determine a cause
544
578
    # get prereqs
545
579
    _expand_result( $result );
546
580
 
 
581
    _report_timeout( $result );
 
582
 
547
583
    # if process was halted with a signal, just set for discard and return
548
584
    if ( $result->{exit_value} & 127 ) {
549
585
        $result->{grade} = 'discard';
562
598
        $harness_error++;
563
599
        last;
564
600
      }
565
 
      if( $line =~ /Perl .*? required.*?--this is only/ims ||
 
601
      if( $line =~ /(?<!skipped: )Perl .*? required.*?--this is only/ims ||
 
602
           #?<! - quick hack for https://github.com/cpan-testers/CPAN-Reporter/issues/23
566
603
        $line =~ /Perl version .*? or higher required\. We run/ims || #EU::MM
567
604
        $line =~ /ERROR: perl: Version .*? is installed, but we need version/ims ||
568
605
        $line =~ /ERROR: perl \(.*?\) is installed, but we need version/ims ||
1505
1542
 
1506
1543
=head1 VERSION
1507
1544
 
1508
 
version 1.2011
 
1545
version 1.2014
1509
1546
 
1510
1547
=head1 SYNOPSIS
1511
1548
 
1667
1704
 
1668
1705
=head1 BUGS
1669
1706
 
 
1707
Using command_timeout on Linux may cause problems. See
 
1708
L<https://rt.cpan.org/Ticket/Display.html?id=62310>
 
1709
 
1670
1710
Please report any bugs or feature using the CPAN Request Tracker.
1671
1711
Bugs can be submitted through the web interface at
1672
1712
L<http://rt.cpan.org/Dist/Display.html?Queue=CPAN-Reporter>
1733
1773
 
1734
1774
=head1 CONTRIBUTORS
1735
1775
 
 
1776
=for stopwords Alexandr Ciornii Breno G. de Oliveira Christian Walde Ed J Kent Fredric Matthew Musgrove Scott Wiersdorf Slaven Rezic
 
1777
 
1736
1778
=over 4
1737
1779
 
1738
1780
=item *
1749
1791
 
1750
1792
=item *
1751
1793
 
 
1794
Ed J <mohawk2@users.noreply.github.com>
 
1795
 
 
1796
=item *
 
1797
 
1752
1798
Kent Fredric <kentfredric@gmail.com>
1753
1799
 
1754
1800
=item *
1755
1801
 
1756
1802
Matthew Musgrove <mr.muskrat@gmail.com>
1757
1803
 
 
1804
=item *
 
1805
 
 
1806
Scott Wiersdorf <scott@perlcode.org>
 
1807
 
 
1808
=item *
 
1809
 
 
1810
Slaven Rezic <slaven@rezic.de>
 
1811
 
1758
1812
=back
1759
1813
 
1760
1814
=head1 COPYRIGHT AND LICENSE