Author: blues Date: Fri Feb 25 08:51:10 2005 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- there is no need to require diagnostic module... + cosmetics
---- Files affected:
SOURCES:
logwatch-sendmail.patch (1.18 -> 1.19) (NEW)
---- Diffs:
================================================================
Index: SOURCES/logwatch-sendmail.patch
diff -u /dev/null SOURCES/logwatch-sendmail.patch:1.19
--- /dev/null Fri Feb 25 09:51:10 2005
+++ SOURCES/logwatch-sendmail.patch Fri Feb 25 09:51:05 2005
@@ -0,0 +1,76 @@
+Index: scripts/services/sendmail
+===================================================================
+RCS file: /var/cvs/logwatch/scripts/services/sendmail,v
+retrieving revision 1.44
+diff -u -r1.44 sendmail
+--- scripts/services/sendmail 24 Feb 2005 17:08:05 -0000 1.44
++++ scripts/services/sendmail 25 Feb 2005 08:50:14 -0000
+@@ -1,4 +1,3 @@
+-
+ ##########################################################################
+ # $Id$
+ ##########################################################################
+@@ -30,36 +29,35 @@
+ ########################################################
+
+ use Logwatch ':sort';
+-use diagnostics;
+
+ sub PrettyHost {
+-# $_[0] is the line to format
+-my $Line = $_[0];
+-# $_[1] is the length available
+-my $LineLength = $_[1];
+-#
+-if ((not defined $sendmail_prettyhost) or ($sendmail_prettyhost == 0)) {
+- return($Line);
+-}
+-($Name, $Addr, $Other) = ($Line =~ /^\s*(.*?)\s*(\[[\d.:]*\])\s*(.*?)\s*$/);
+-if (index($Line, "\[") < 0) {
+- $Name = $Line;
+-}
+-if (not defined $Name) {$Name=""};
+-if (not defined $Addr) {$Addr=""};
+-if (not defined $Other) {$Other=""};
+-if ($Other ne "") {
+- $Name = $Name . " " . $Other;
+-}
+-# From LineLength, we will use 18 chars for one space
+-# and a full IPv4 address
+-
+-while ((length($Name) > $LineLength-18) and (($Name =~ tr/\./\./) > 1) ) {
+- $Name =~ s/[^\.]*\.(.*)/$1/;
+-}
+-
+-sprintf ("%*s %-17s", 18-$LineLength, $Name, $Addr);
+-
++ # $_[0] is the line to format
++ my $Line = $_[0];
++ # $_[1] is the length available
++ my $LineLength = $_[1];
++ #
++ if ((not defined $sendmail_prettyhost) or ($sendmail_prettyhost == 0)) {
++ return($Line);
++ }
++
++ ($Name, $Addr, $Other) = ($Line =~
/^\s*(.*?)\s*(\[[\d.:]*\])\s*(.*?)\s*$/);
++ if (index($Line, "\[") < 0) {
++ $Name = $Line;
++ }
++ if (not defined $Name) {$Name=""};
++ if (not defined $Addr) {$Addr=""};
++ if (not defined $Other) {$Other=""};
++ if ($Other ne "") {
++ $Name = $Name . " " . $Other;
++ }
++ # From LineLength, we will use 18 chars for one space
++ # and a full IPv4 address
++
++ while ((length($Name) > $LineLength-18) and (($Name =~ tr/\./\./) > 1) ) {
++ $Name =~ s/[^\.]*\.(.*)/$1/;
++ }
++
++ sprintf ("%*s %-17s", 18-$LineLength, $Name, $Addr);
+ }
+
+ my $LogwatchDetail = $ENV{'LOGWATCH_DETAIL_LEVEL'} || 0;
================================================================
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit