r9087 - in /branches/upstream/libsys-syslog-perl/current: ._Syslog.pm Changes META.yml Makefile.PL Syslog.pm t/._syslog.t win32/._Win32.pm win32/._compile.pl

gregoa-guest at users.alioth.debian.org gregoa-guest at users.alioth.debian.org
Fri Nov 9 16:28:15 UTC 2007


Author: gregoa-guest
Date: Fri Nov  9 16:28:14 2007
New Revision: 9087

URL: http://svn.debian.org/wsvn/?sc=1&rev=9087
Log:
[svn-upgrade] Integrating new upstream version, libsys-syslog-perl (0.22)

Added:
    branches/upstream/libsys-syslog-perl/current/._Syslog.pm   (with props)
    branches/upstream/libsys-syslog-perl/current/t/._syslog.t   (with props)
    branches/upstream/libsys-syslog-perl/current/win32/._Win32.pm   (with props)
    branches/upstream/libsys-syslog-perl/current/win32/._compile.pl   (with props)
Modified:
    branches/upstream/libsys-syslog-perl/current/Changes
    branches/upstream/libsys-syslog-perl/current/META.yml
    branches/upstream/libsys-syslog-perl/current/Makefile.PL
    branches/upstream/libsys-syslog-perl/current/Syslog.pm

Added: branches/upstream/libsys-syslog-perl/current/._Syslog.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libsys-syslog-perl/current/._Syslog.pm?rev=9087&op=file
==============================================================================
Binary file - no diff available.

Propchange: branches/upstream/libsys-syslog-perl/current/._Syslog.pm
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: branches/upstream/libsys-syslog-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libsys-syslog-perl/current/Changes?rev=9087&op=diff
==============================================================================
--- branches/upstream/libsys-syslog-perl/current/Changes (original)
+++ branches/upstream/libsys-syslog-perl/current/Changes Fri Nov  9 16:28:14 2007
@@ -1,8 +1,19 @@
 Revision history for Sys-Syslog
+
+0.22 -- 2007.11.08 -- Sebastien Aperghis-Tramoni (SAPER)
+        [BUGFIX] CPAN-RT#29875: Added workaround SpamAssassin overzealous
+        logging features.
+        [FEATURE] Added support for PERROR option.
+        [FEATURE] Support for SYSLOG on z/OS, thanks to Chun Bing Ge.
+        [CODE] Prevent $@ from being visible outside the module, in trying 
+        to address the problem reported in CPAN-RT#29875.
+        [DOC] CPAN-RT#29451: Add Copyright notice. Thanks to Allison Randal
+        for her advice.
+        [DOC] New speaking about Win32 API instead of Win32 operating system.
 
 0.21 -- 2007.09.14 -- Sebastien Aperghis-Tramoni (SAPER)
         [BUGFIX] setlogsock(eventlog) returned true even when it shouldn't have.
-        [BUGFIX] Added workaround for Mac OS X syslogd.
+        [BUGFIX] CPAN-RT#24431: Added workaround for Mac OS X syslogd.
         [FEATURE] Added "pipe" mechanism in order to support HP-UX named pipe.
         Thanks to H.Merijn Brand and PROCURA.
         [CODE] Sys::Syslog works again on Perl 5.005, thanks to Nicholas Clark.

Modified: branches/upstream/libsys-syslog-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libsys-syslog-perl/current/META.yml?rev=9087&op=diff
==============================================================================
--- branches/upstream/libsys-syslog-perl/current/META.yml (original)
+++ branches/upstream/libsys-syslog-perl/current/META.yml Fri Nov  9 16:28:14 2007
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:                Sys-Syslog
-version:             0.21
+version:             0.22
 abstract:            Perl interface to the UNIX syslog(3) calls
 license:             perl
 generated_by:        ExtUtils::MakeMaker version 6.36

Modified: branches/upstream/libsys-syslog-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/branches/upstream/libsys-syslog-perl/current/Makefile.PL?rev=9087&op=diff
==============================================================================
--- branches/upstream/libsys-syslog-perl/current/Makefile.PL (original)
+++ branches/upstream/libsys-syslog-perl/current/Makefile.PL Fri Nov  9 16:28:14 2007
@@ -108,7 +108,7 @@
     # On HP-UX, /dev/log isn't a unix domain socket but a named pipe.
     $_PATH_LOG = "/dev/log";
 }
-elsif (-S "/dev/log" and -w _) {
+elsif ((-S "/dev/log" or -c _) and -w _) {
     # Most unixes have a unix domain socket /dev/log.
     $_PATH_LOG = "/dev/log";
 }

Modified: branches/upstream/libsys-syslog-perl/current/Syslog.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libsys-syslog-perl/current/Syslog.pm?rev=9087&op=diff
==============================================================================
--- branches/upstream/libsys-syslog-perl/current/Syslog.pm (original)
+++ branches/upstream/libsys-syslog-perl/current/Syslog.pm Fri Nov  9 16:28:14 2007
@@ -10,7 +10,7 @@
 require Exporter;
 
 {   no strict 'vars';
-    $VERSION = '0.21';
+    $VERSION = '0.22';
     @ISA = qw(Exporter);
 
     %EXPORT_TAGS = (
@@ -94,6 +94,7 @@
     ndelay  => 0, 
     nofatal => 0, 
     nowait  => 0, 
+    perror  => 0, 
     pid     => 0, 
 );
 
@@ -104,14 +105,20 @@
     @connectMethods = grep { $_ ne 'udp' } @connectMethods;
 }
 
-# use EventLog on Win32
-my $is_Win32 = $^O =~ /Win32/i;
-eval "use Sys::Syslog::Win32";
-
-if (not $@) {
-    unshift @connectMethods, 'eventlog';
-} elsif ($is_Win32) {
-    warn $@;
+EVENTLOG: {
+    # use EventLog on Win32
+    my $is_Win32 = $^O =~ /Win32/i;
+
+    # some applications are trying to be too smart
+    # yes I'm speaking of YOU, SpamAssassin, grr..
+    local($SIG{__DIE__}, $SIG{__WARN__}, $@);
+
+    if (eval "use Sys::Syslog::Win32; 1") {
+        unshift @connectMethods, 'eventlog';
+    }
+    elsif ($is_Win32) {
+        warn $@;
+    }
 }
 
 my @defaultMethods = @connectMethods;
@@ -233,7 +240,8 @@
         if (eval "use Win32::EventLog; 1") {
             @connectMethods = qw(eventlog);
         } else {
-            warnings::warnif "eventlog passed to setlogsock, but operating system isn't Win32-compatible";
+            warnings::warnif "eventlog passed to setlogsock, but no Win32 API available";
+            $@ = "";
             return undef;
         }
 
@@ -326,11 +334,11 @@
     $message = @_ ? sprintf($mask, @_) : $mask;
 
     # See CPAN-RT#24431. Opened on Apple Radar as bug #4944407 on 2007.01.21
+    # Supposedly resolved on Leopard.
     chomp $message if $^O =~ /darwin/;
 
     if ($current_proto eq 'native') {
         $buf = $message;
-
     }
     elsif ($current_proto eq 'eventlog') {
         $buf = $message;
@@ -345,6 +353,15 @@
         my $timestamp = strftime "%b %e %T", localtime;
         setlocale(LC_TIME, $oldlocale);
         $buf = "<$sum>$timestamp $whoami: $message\0";
+    }
+
+    # handle PERROR option
+    # "native" mechanism already handles it by itself
+    if ($options{perror} and $current_proto ne 'native') {
+        chomp $message;
+        my $whoami = $ident;
+        $whoami .= "[$$]" if $options{pid};
+        print STDERR "$whoami: $message\n";
     }
 
     # it's possible that we'll get an error from sending
@@ -454,7 +471,8 @@
     $name = "Sys::Syslog::$name";
     # Can't have just eval { &$name } || -1 because some LOG_XXX may be zero.
     my $value = eval { no strict 'refs'; &$name };
-    defined $value ? $value : -1;
+    $@ = "";
+    return defined $value ? $value : -1;
 }
 
 
@@ -532,6 +550,7 @@
         # These constants don't exist in 5.005. They were added in 1999
         setsockopt(SYSLOG, IPPROTO_TCP(), TCP_NODELAY(), 1);
     }
+    $@ = "";
     if (!connect(SYSLOG, $addr)) {
 	push @$errs, "tcp connect: $!";
 	return 0;
@@ -638,7 +657,7 @@
 	return 0;
     }
 
-    if (! -S $syslog_path) {
+    if (not (-S $syslog_path or -c _)) {
         push @$errs, "$syslog_path is not a socket";
 	return 0;
     }
@@ -752,7 +771,7 @@
 
 =head1 VERSION
 
-Version 0.21
+Version 0.22
 
 =head1 SYNOPSIS
 
@@ -854,6 +873,11 @@
 
 =item *
 
+C<perror> - Write the message to standard error output as well to the
+system log.
+
+=item *
+
 C<pid> - Include PID with each message.
 
 =back
@@ -1003,8 +1027,8 @@
 mechanisms which are attempted in order.
 
 The default is to try C<native>, C<tcp>, C<udp>, C<unix>, C<stream>, C<console>.
-Under Win32 systems, C<eventlog> will be added as the first mechanism to try 
-if C<Win32::EventLog> is available.
+Under systems with the Win32 API, C<eventlog> will be added as the first 
+mechanism to try if C<Win32::EventLog> is available.
 
 Giving an invalid value for C<$sock_type> will C<croak>.
 
@@ -1247,11 +1271,11 @@
 
 B<(F)> You gave C<setlogsock()> an invalid value for C<$sock_type>. 
 
-=item C<eventlog passed to setlogsock, but operating system isn't Win32-compatible>
+=item C<eventlog passed to setlogsock, but no Win32 API available>
 
 B<(W)> You asked C<setlogsock()> to use the Win32 event logger but the 
 operating system running the program isn't Win32 or does not provides Win32
-facilities.
+compatible facilities.
 
 =item C<no connection to syslog available>
 
@@ -1387,7 +1411,7 @@
 
 Please report any bugs or feature requests to
 C<bug-sys-syslog (at) rt.cpan.org>, or through the web interface at
-L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Sys-Syslog>.
+L<http://rt.cpan.org/Public/Dist/Display.html?Name=Sys-Syslog>.
 I will be notified, and then you'll automatically be notified of progress on
 your bug as I make changes.
 
@@ -1427,6 +1451,11 @@
 L<http://perldoc.perl.org/Sys/Syslog.html>
 
 =back
+
+
+=head1 COPYRIGHT
+
+Copyright (C) 1990-2007 by Larry Wall and others.
 
 
 =head1 LICENSE

Added: branches/upstream/libsys-syslog-perl/current/t/._syslog.t
URL: http://svn.debian.org/wsvn/branches/upstream/libsys-syslog-perl/current/t/._syslog.t?rev=9087&op=file
==============================================================================
Binary file - no diff available.

Propchange: branches/upstream/libsys-syslog-perl/current/t/._syslog.t
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: branches/upstream/libsys-syslog-perl/current/win32/._Win32.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libsys-syslog-perl/current/win32/._Win32.pm?rev=9087&op=file
==============================================================================
Binary file - no diff available.

Propchange: branches/upstream/libsys-syslog-perl/current/win32/._Win32.pm
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: branches/upstream/libsys-syslog-perl/current/win32/._compile.pl
URL: http://svn.debian.org/wsvn/branches/upstream/libsys-syslog-perl/current/win32/._compile.pl?rev=9087&op=file
==============================================================================
Binary file - no diff available.

Propchange: branches/upstream/libsys-syslog-perl/current/win32/._compile.pl
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream




More information about the Pkg-perl-cvs-commits mailing list