aboutsummaryrefslogtreecommitdiff
path: root/mail/sa-stats
diff options
context:
space:
mode:
authorAlexey Degtyarev <alexey@FreeBSD.org>2014-05-31 08:37:18 +0000
committerAlexey Degtyarev <alexey@FreeBSD.org>2014-05-31 08:37:18 +0000
commit2c12f85bf044872f094538010a2b5156a3226a91 (patch)
tree56f18e08a944a99f74d57aaec28075c52e962097 /mail/sa-stats
parente64bb3f5552c9a78bf06c5e607e4be33f989cf68 (diff)
downloadports-2c12f85bf044872f094538010a2b5156a3226a91.tar.gz
ports-2c12f85bf044872f094538010a2b5156a3226a91.zip
Notes
Diffstat (limited to 'mail/sa-stats')
-rw-r--r--mail/sa-stats/Makefile1
-rw-r--r--mail/sa-stats/files/patch-za20
2 files changed, 21 insertions, 0 deletions
diff --git a/mail/sa-stats/Makefile b/mail/sa-stats/Makefile
index 1fe0700160b8..268e606bb76c 100644
--- a/mail/sa-stats/Makefile
+++ b/mail/sa-stats/Makefile
@@ -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/
diff --git a/mail/sa-stats/files/patch-za b/mail/sa-stats/files/patch-za
new file mode 100644
index 000000000000..f6ad8bbfbaa7
--- /dev/null
+++ b/mail/sa-stats/files/patch-za
@@ -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++;