Imported Upstream version 3.3.2
[debian/amanda] / perl / Amanda / Report.pm
index 78a3c303425ca1508ab546aea68897eb9bebd44c..8c514614efb6f0e5ccd2d90101075795ea6e49e7 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2010 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2010-2012 Zmanda, Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 as published
@@ -510,10 +510,22 @@ sub read_line
 
     if ( $type == $L_CONT ) {
        ${$self->{nbline_ref}}++;
-       push @{$self->{contline}}, $str if ${$self->{nbline_ref}} <= 100;
+       if ($str =~ /^\|/) {
+           $self->{nb_strange}++;
+           push @{$self->{contline}}, $str if $self->{nb_strange} + $self->{nb_error} <= 100;
+       } elsif ($str =~ /^\?/) {
+           $self->{nb_error}++;
+           push @{$self->{contline}}, $str if $self->{nb_error} <= 100;
+       } else {
+           $self->{nb_normal}++;
+           push @{$self->{contline}}, $str if ${$self->{nbline_ref}} <= 100;
+       }
        return;
     }
     $self->{contline} = undef;
+    $self->{nb_normal} = 0;
+    $self->{nb_strange} = 0;
+    $self->{nb_error} = 0;
 
     if ( $prog == $P_PLANNER ) {
         return $self->_handle_planner_line( $type, $str );
@@ -806,6 +818,9 @@ sub _handle_dumper_line
        $self->{contline} = $dumper->{stranges} ||= [];
        $dumper->{nb_stranges} = 0;
        $self->{nbline_ref} = \$dumper->{nb_stranges};
+       $self->{nb_normal} = 0;
+       $self->{nb_strange} = 0;
+       $self->{nb_error} = 0;
 
         return $self->{flags}{exit_status} |= STATUS_STRANGE
 
@@ -1153,6 +1168,9 @@ sub _handle_fail_line
         $self->{contline} = $program_d->{errors} ||= [];
        $program_d->{nb_errors} = 0;
        $self->{nbline_ref} = \$program_d->{nb_errors};
+       $self->{nb_normal} = 0;
+       $self->{nb_strange} = 0;
+       $self->{nb_error} = 0;
     }
 }