ports/99886: amavis-stats port does not work

Oleg Gawriloff barzog at telecom.by
Fri Jul 7 15:00:49 UTC 2006


>Number:         99886
>Category:       ports
>Synopsis:       amavis-stats port does not work
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 07 15:00:46 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Oleg Gawriloff
>Release:        5.4
>Organization:
Atlant Telecom
>Environment:
FreeBSD albatros.telecom.by 5.4-RELEASE-p13 FreeBSD 5.4-RELEASE-p13 #1: Mon Jun  5 14:04:54 EEST 2006     root at albatros.telecom.by:/usr/src/sys/i386/compile/ALBATROS  i386

>Description:
After installing amavis-stats port, when we try to execute /usr/local/sbin/amavis-stats we see following errors:
syntax error at ./amavis-stats line 215, near "err"
syntax error at ./amavis-stats line 223, near "}"
Execution of ./amavis-stats aborted due to compilation errors.


>How-To-Repeat:

>Fix:
--- amavis-stats	Fri Jul  7 17:39:25 2006
+++ /usr/local/sbin/amavis-stats	Fri Jul  7 17:54:33 2006
@@ -1,4 +1,4 @@
-#! /usr/bin/perl
+#!/usr/bin/perl -w
 #
 # amavis-stats -- generate rrds from amavis log output
 #
@@ -28,6 +28,7 @@
 # ########################################################################
 use strict;
 use warnings;
+use diagnostics;
 use Getopt::Std;
 use Time::localtime;
 use Time::Local;
@@ -212,7 +213,7 @@
 sub semlock {
     open (LOCKF, ">$lockfile") or do_exit(1, "Could not open $lockfile: $!");
     unless (flock(LOCKF, LOCK_EX | LOCK_NB)) {
-        err("warning: Could not lock $lockfile: $!");
+        print_err("warning: Could not lock $lockfile: $!");
         sleep 2;
         unless (flock(LOCKF, LOCK_EX | LOCK_NB)) {
             do_exit(1, "Could not lock $lockfile: $!");
@@ -680,8 +681,8 @@
     if (defined($rotlogfile)) {
         parseFile ($rotlogfile, $spos, (stat $rotlogfile)[7]);
     } else {
-        err("Could not open rotated logfile.");
-        err("  Tried extentions .0, .1, .01, -$today, -$yesterday");
+        print_err("Could not open rotated logfile.");
+        print_err("  Tried extentions .0, .1, .01, -$today, -$yesterday");
         do_exit(1);
     }
 }
@@ -707,7 +708,7 @@
 
     my $err = RRDs::error;
     if ($err) {
-        err("createRRD: $err");
+        print_err("createRRD: $err");
         return -1;
     }
 
@@ -736,7 +737,7 @@
     $last = RRDs::last($rrdfile);
     $err = RRDs::error;
     if ($err) {
-        err("updateRRD: $err");
+        print_err("updateRRD: $err");
         return -1;
     }
 
@@ -750,8 +751,8 @@
 
         $err = RRDs::error;
         if ($err) {
-            err("updateRRD: $err");
-            err("Attempted to update $rrdfile at $epoch count $count");
+            print_err("updateRRD: $err");
+            print_err("Attempted to update $rrdfile at $epoch count $count");
             return -1;
         }
     }
@@ -769,7 +770,8 @@
     print "$me: @_\n" if ($verbose);
 }
 
-sub err {
+sub print_err
+{
     print STDERR "$me: error: @_\n";
 }

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list