From owner-svn-ports-all@FreeBSD.ORG Sat May 31 08:37:19 2014 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F2C2C70; Sat, 31 May 2014 08:37:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63DD72427; Sat, 31 May 2014 08:37:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4V8bJ6x088764; Sat, 31 May 2014 08:37:19 GMT (envelope-from alexey@svn.freebsd.org) Received: (from alexey@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4V8bJS2088762; Sat, 31 May 2014 08:37:19 GMT (envelope-from alexey@svn.freebsd.org) Message-Id: <201405310837.s4V8bJS2088762@svn.freebsd.org> From: Alexey Degtyarev Date: Sat, 31 May 2014 08:37:19 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r355946 - in head/mail/sa-stats: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 May 2014 08:37:19 -0000 Author: alexey Date: Sat May 31 08:37:18 2014 New Revision: 355946 URL: http://svnweb.freebsd.org/changeset/ports/355946 QAT: https://qat.redports.org/buildarchive/r355946/ Log: Fix illegal division by zero. Upstream support seems abandoned, thus attaching patch to files/. Approved by: wg (mentor) Added: head/mail/sa-stats/files/ head/mail/sa-stats/files/patch-za (contents, props changed) Modified: head/mail/sa-stats/Makefile Modified: head/mail/sa-stats/Makefile ============================================================================== --- head/mail/sa-stats/Makefile Sat May 31 08:32:05 2014 (r355945) +++ head/mail/sa-stats/Makefile Sat May 31 08:37:18 2014 (r355946) @@ -3,6 +3,7 @@ PORTNAME= sa-stats PORTVERSION= 1.0 +PORTREVISION= 1 CATEGORIES= mail MASTER_SITES= http://www.rulesemporium.com/programs/ \ ftp://renatasystems.org/pub/FreeBSD/ports/distfiles/ Added: head/mail/sa-stats/files/patch-za ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/mail/sa-stats/files/patch-za Sat May 31 08:37:18 2014 (r355946) @@ -0,0 +1,20 @@ +--- sa-stats-1.0.txt 2014-05-09 07:43:35.000000000 +0200 ++++ sa-stats-1.0.txt 2014-05-24 08:00:28.000000000 +0200 +@@ -269,7 +269,7 @@ sub summarize { + #my $perc1=sprintf("%.2f",($SPAM_RULES{$key}/$NUM_EMAIL)*100); + my $perc1=sprintf("%.2f",(($SPAM_RULES{$key}+$HAM_RULES{$key})/$NUM_EMAIL)*100); + my $perc2=sprintf("%.2f",($SPAM_RULES{$key}/$NUM_SPAM)*100); +- my $perc3=sprintf("%.2f",($HAM_RULES{$key}/$NUM_HAM)*100); ++ my $perc3=sprintf("%.2f",($NUM_HAM > 0 ? $HAM_RULES{$key}/$NUM_HAM : 0)*100); + printf("%4d\t%-24s\t%5s\t%6.2f\t%6.2f\t%6.2f\n",$count+1,$key,$SPAM_RULES{$key},$perc1,$perc2,$perc3); + $count++; + if ($count >= $TOPRULES && $TOPRULES > 0) { +@@ -289,7 +289,7 @@ sub summarize { + foreach my $key (sort { $HAM_RULES{$b} <=> $HAM_RULES{$a} } keys %HAM_RULES) { + #my $perc1=sprintf("%.2f",($HAM_RULES{$key}/$NUM_EMAIL)*100); + my $perc1=sprintf("%.2f",(($SPAM_RULES{$key}+$HAM_RULES{$key})/$NUM_EMAIL)*100); +- my $perc2=sprintf("%.2f",($SPAM_RULES{$key}/$NUM_SPAM)*100); ++ my $perc2=sprintf("%.2f",($NUM_SPAM > 0 ? $SPAM_RULES{$key}/$NUM_SPAM : 0)*100); + my $perc3=sprintf("%.2f",($HAM_RULES{$key}/$NUM_HAM)*100); + printf("%4d\t%-24s\t%5s\t%6.2f\t%6.2f\t%6.2f\n",$count+1,$key,$HAM_RULES{$key},$perc1,$perc2,$perc3); + $count++;