[Midnightbsd-cvs] mports: lib/Magus: Various bug fixes.

ctriv at midnightbsd.org ctriv at midnightbsd.org
Mon Oct 22 01:59:35 EDT 2007


Log Message:
-----------
Various bug fixes.

Modified Files:
--------------
    mports/Tools/lib/Magus:
        Chroot.pm (r1.6 -> r1.7)
        Config.pm (r1.1 -> r1.2)
        DBI.pm (r1.1 -> r1.2)
        Depend.pm (r1.1 -> r1.2)
        Index.pm (r1.2 -> r1.3)
        Lock.pm (r1.1 -> r1.2)
        Port.pm (r1.1 -> r1.2)
        PortTest.pm (r1.2 -> r1.3)
        Result.pm (r1.1 -> r1.2)
        SubResult.pm (r1.1 -> r1.2)
    mports/Tools/lib/Magus/OutcomeRules:
        Base.pm (r1.2 -> r1.3)

-------------- next part --------------
Index: SubResult.pm
===================================================================
RCS file: /home/cvs/mports/Tools/lib/Magus/SubResult.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -LTools/lib/Magus/SubResult.pm -LTools/lib/Magus/SubResult.pm -u -r1.1 -r1.2
--- Tools/lib/Magus/SubResult.pm
+++ Tools/lib/Magus/SubResult.pm
@@ -1,8 +1,35 @@
 package Magus::SubResult;
 #
+# Copyright (c) 2007 Chris Reinhardt. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# 1. Redistributions of source code must retain the above copyright notice
+#    this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
 # $MidnightBSD$
+# 
+# MAINTAINER=   ctriv at MidnightBSD.org
 #
 
+
 use strict;
 use warnings;
 use base qw(Magus::DBI);
Index: Port.pm
===================================================================
RCS file: /home/cvs/mports/Tools/lib/Magus/Port.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -LTools/lib/Magus/Port.pm -LTools/lib/Magus/Port.pm -u -r1.1 -r1.2
--- Tools/lib/Magus/Port.pm
+++ Tools/lib/Magus/Port.pm
@@ -1,7 +1,36 @@
 package Magus::Port;
 #
+# Copyright (c) 2007 Chris Reinhardt. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# 1. Redistributions of source code must retain the above copyright notice
+#    this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
 # $MidnightBSD$
+# 
+# MAINTAINER=   ctriv at MidnightBSD.org
 #
+
+
+
 use strict;
 use warnings;
 
Index: DBI.pm
===================================================================
RCS file: /home/cvs/mports/Tools/lib/Magus/DBI.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -LTools/lib/Magus/DBI.pm -LTools/lib/Magus/DBI.pm -u -r1.1 -r1.2
--- Tools/lib/Magus/DBI.pm
+++ Tools/lib/Magus/DBI.pm
@@ -1,4 +1,34 @@
 package Magus::DBI;
+#
+# Copyright (c) 2007 Chris Reinhardt. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# 1. Redistributions of source code must retain the above copyright notice
+#    this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# $MidnightBSD$
+# 
+# MAINTAINER=   ctriv at MidnightBSD.org
+#
+
 
 use strict;
 use warnings;
Index: Chroot.pm
===================================================================
RCS file: /home/cvs/mports/Tools/lib/Magus/Chroot.pm,v
retrieving revision 1.6
retrieving revision 1.7
diff -LTools/lib/Magus/Chroot.pm -LTools/lib/Magus/Chroot.pm -u -r1.6 -r1.7
--- Tools/lib/Magus/Chroot.pm
+++ Tools/lib/Magus/Chroot.pm
@@ -33,6 +33,9 @@
 use warnings;
 use File::Path qw(mkpath rmtree);
 
+# load Carp::Heavy so its in memory before we chroot.
+use Carp::Heavy;
+
 =head1 NAME 
 
 Magus::Chroot
Index: Lock.pm
===================================================================
RCS file: /home/cvs/mports/Tools/lib/Magus/Lock.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -LTools/lib/Magus/Lock.pm -LTools/lib/Magus/Lock.pm -u -r1.1 -r1.2
--- Tools/lib/Magus/Lock.pm
+++ Tools/lib/Magus/Lock.pm
@@ -1,8 +1,36 @@
 package Magus::Lock;
 #
+# Copyright (c) 2007 Chris Reinhardt. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# 1. Redistributions of source code must retain the above copyright notice
+#    this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
 # $MidnightBSD$
+# 
+# MAINTAINER=   ctriv at MidnightBSD.org
 #
 
+
+
 use base qw(Magus::DBI);
 use strict;
 use warnings;
Index: Index.pm
===================================================================
RCS file: /home/cvs/mports/Tools/lib/Magus/Index.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -LTools/lib/Magus/Index.pm -LTools/lib/Magus/Index.pm -u -r1.2 -r1.3
--- Tools/lib/Magus/Index.pm
+++ Tools/lib/Magus/Index.pm
@@ -1,7 +1,34 @@
 package Magus::Index;
 #
+# Copyright (c) 2007 Chris Reinhardt. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# 1. Redistributions of source code must retain the above copyright notice
+#    this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
 # $MidnightBSD$
+# 
+# MAINTAINER=   ctriv at MidnightBSD.org
 #
+
 use strict;
 use warnings;
 
Index: Config.pm
===================================================================
RCS file: /home/cvs/mports/Tools/lib/Magus/Config.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -LTools/lib/Magus/Config.pm -LTools/lib/Magus/Config.pm -u -r1.1 -r1.2
--- Tools/lib/Magus/Config.pm
+++ Tools/lib/Magus/Config.pm
@@ -1,7 +1,34 @@
 package Magus::Config;
 #
+# Copyright (c) 2007 Chris Reinhardt. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# 1. Redistributions of source code must retain the above copyright notice
+#    this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
 # $MidnightBSD$
 # 
+# MAINTAINER=   ctriv at MidnightBSD.org
+#
+
 
 use strict;
 use warnings;
Index: Result.pm
===================================================================
RCS file: /home/cvs/mports/Tools/lib/Magus/Result.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -LTools/lib/Magus/Result.pm -LTools/lib/Magus/Result.pm -u -r1.1 -r1.2
--- Tools/lib/Magus/Result.pm
+++ Tools/lib/Magus/Result.pm
@@ -1,8 +1,36 @@
 package Magus::Result;
 #
+# Copyright (c) 2007 Chris Reinhardt. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# 1. Redistributions of source code must retain the above copyright notice
+#    this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
 # $MidnightBSD$
+# 
+# MAINTAINER=   ctriv at MidnightBSD.org
 #
 
+
+
 use base qw(Magus::DBI);
 use strict;
 use warnings;
Index: Depend.pm
===================================================================
RCS file: /home/cvs/mports/Tools/lib/Magus/Depend.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -LTools/lib/Magus/Depend.pm -LTools/lib/Magus/Depend.pm -u -r1.1 -r1.2
--- Tools/lib/Magus/Depend.pm
+++ Tools/lib/Magus/Depend.pm
@@ -1,7 +1,34 @@
 package Magus::Depend;
 #
+# Copyright (c) 2007 Chris Reinhardt. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# 1. Redistributions of source code must retain the above copyright notice
+#    this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
 # $MidnightBSD$
+# 
+# MAINTAINER=   ctriv at MidnightBSD.org
 #
+
 use strict;
 use warnings;
 
Index: PortTest.pm
===================================================================
RCS file: /home/cvs/mports/Tools/lib/Magus/PortTest.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -LTools/lib/Magus/PortTest.pm -LTools/lib/Magus/PortTest.pm -u -r1.2 -r1.3
--- Tools/lib/Magus/PortTest.pm
+++ Tools/lib/Magus/PortTest.pm
@@ -79,6 +79,29 @@
 
 Runs the test and returns a data structure representing the results.
 
+$results = {
+  summary => 'fail',
+  errors  => [
+    {
+      phase => 'fake',
+      msg   => 'make fake returned non-zero: 1',
+      name  => 'MakeExitNonZero',
+    },
+    {
+      phase => 'fake',
+      msg   => 'A file was installed in the final dir instead of the fake dir.',
+      name  => 'FakedOutsideDestdir',
+    }
+  ],
+  warnings => [
+    {
+      phase => 'patch',
+      msg   => 'LICENSE is not set.',
+      name  => 'NoLicense',
+    }
+  ],
+};     
+
 =cut
 
 sub run {
@@ -87,7 +110,7 @@
   $self->_set_env;
   $self->{chroot}->mark_dirty;
 
-  my %results;
+  my %results = (summary => 'pass');
   
   foreach my $target (qw(fetch extract patch configure build fake package install deinstall reinstall)) {
     if (!$self->_run_make($target)) {
@@ -103,8 +126,11 @@
     my $testclass = "Magus::OutcomeRules::$target";
     
     my $presults = $testclass->test("$self->{logdir}/$target");
-
-    $results{summary} = $presults->{summary} if $presults->{summary} eq 'fail';
+    
+    # update the summary if the phase results is worse than what we had.
+    if ($results{summary} eq 'pass' || ($results{summary} eq 'warn' && $presults->{'summary'} ne 'pass') {
+      $results{summary} = $presults->{summary};
+    } 
         
     if ($presults->{errors}) {
       push(@{$results{errors}}, @{$presults->{errors}});
@@ -114,22 +140,19 @@
       push(@{$results{warnings}}, @{$presults->{warnings}});
     }
     
-    if ($presults->{summary} eq 'fail') {
+    if ($results{summary} eq 'fail') {
       last;
     }
   }
   
-  $results{summary} ||= 'pass';
-  
   return \%results;
 }
 
 
 sub _run_make {
   my ($self, $target) = @_;
-  
-  chdir($self->{port}->origin);
 
+  chdir($self->{port}->origin) || die "Couldn't chdir to " . $self->{port}->origin . ": $!\n";
   return system("$MAKE $target >$self->{logdir}/$target 2>&1") == 0;
 }  
 
@@ -139,7 +162,7 @@
   
   $ENV{PACKAGES}       		= $self->{chroot}->packages;
   $ENV{WRKDIRPREFIX}  		= $self->{chroot}->workdir;
-  $ENV{DEPENDS_TARGET} 		= 'magus-broken-depend';
+  $ENV{DEPENDS_TARGET} 		= 'magus-install-depend';
   $ENV{DISTDIR}        		= $self->{chroot}->distfiles;
   $ENV{MAGUS}          		= 1;
   $ENV{BATCH}	       		= 1;
Index: Base.pm
===================================================================
RCS file: /home/cvs/mports/Tools/lib/Magus/OutcomeRules/Base.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -LTools/lib/Magus/OutcomeRules/Base.pm -LTools/lib/Magus/OutcomeRules/Base.pm -u -r1.2 -r1.3
--- Tools/lib/Magus/OutcomeRules/Base.pm
+++ Tools/lib/Magus/OutcomeRules/Base.pm
@@ -106,26 +106,28 @@
   
   # This kinda sucks (O(n^2)), but it's abstract enough that it can optimized later.
   while (<$log>) {
-    foreach my $rule (@{$class->error_rules || []}) {
-      if (my $msg = $rule->{code}->()) {
-        $result{summary} = 'fail';
-        push(@{$result{errors}}, {
+    foreach my $rule (@{$class->warning_rules || []}) {
+      if (my $msg = $rule->()) {
+        $result{summary} = 'warn' if $result{summary} eq 'pass';
+        push(@{$result{warnings}}, {
           phase => $rule->{phase},
           msg   => $msg,
           name  => $rule->{name},
         });
       }
     }
-  
-    foreach my $rule (@{$class->warning_rules || []}) {
-      if (my $msg = $rule->()) {
-        push(@{$result{warnings}}, {
+
+    foreach my $rule (@{$class->error_rules || []}) {
+      if (my $msg = $rule->{code}->()) {
+        $result{summary} = 'fail';
+        push(@{$result{errors}}, {
           phase => $rule->{phase},
           msg   => $msg,
           name  => $rule->{name},
         });
       }
     }
+  
   }
 
   close($log) || die "Couldn't close $file: $!\n";


More information about the Midnightbsd-cvs mailing list