r7685 - in /trunk/libsys-syslog-perl: Changes META.yml Makefile.PL README.win32 Syslog.pm Syslog.xs debian/changelog t/syslog.t

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Tue Sep 18 05:59:46 UTC 2007


Author: dmn
Date: Tue Sep 18 05:59:46 2007
New Revision: 7685

URL: http://svn.debian.org/wsvn/?sc=1&rev=7685
Log:
* New upstream release

Modified:
    trunk/libsys-syslog-perl/Changes
    trunk/libsys-syslog-perl/META.yml
    trunk/libsys-syslog-perl/Makefile.PL
    trunk/libsys-syslog-perl/README.win32
    trunk/libsys-syslog-perl/Syslog.pm
    trunk/libsys-syslog-perl/Syslog.xs
    trunk/libsys-syslog-perl/debian/changelog
    trunk/libsys-syslog-perl/t/syslog.t

Modified: trunk/libsys-syslog-perl/Changes
URL: http://svn.debian.org/wsvn/trunk/libsys-syslog-perl/Changes?rev=7685&op=diff
==============================================================================
--- trunk/libsys-syslog-perl/Changes (original)
+++ trunk/libsys-syslog-perl/Changes Tue Sep 18 05:59:46 2007
@@ -1,4 +1,11 @@
 Revision history for Sys-Syslog
+
+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.
+        [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.
 
 0.20 -- 2007.09.05 -- Sebastien Aperghis-Tramoni (SAPER)
         [DOC] Added README.win32 which was missing in MANIFEST.
@@ -24,6 +31,7 @@
         [TESTS] Merged change blead at 29176: suppress taint mode from t/constants.t
         [TESTS] Added regression tests for CPAN-RT#21866 and #25488.
         [EG] Added example script eg/syslog.pl
+        [DOC] CPAN-RT#26097: man pages were not installed.
         [DOC] Added the Sys::Syslog Rules.
 
 0.18 -- 2006.08.28 -- Sebastien Aperghis-Tramoni (SAPER)

Modified: trunk/libsys-syslog-perl/META.yml
URL: http://svn.debian.org/wsvn/trunk/libsys-syslog-perl/META.yml?rev=7685&op=diff
==============================================================================
--- trunk/libsys-syslog-perl/META.yml (original)
+++ trunk/libsys-syslog-perl/META.yml Tue Sep 18 05:59:46 2007
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:                Sys-Syslog
-version:             0.20
+version:             0.21
 abstract:            Perl interface to the UNIX syslog(3) calls
 license:             perl
 generated_by:        ExtUtils::MakeMaker version 6.36

Modified: trunk/libsys-syslog-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/trunk/libsys-syslog-perl/Makefile.PL?rev=7685&op=diff
==============================================================================
--- trunk/libsys-syslog-perl/Makefile.PL (original)
+++ trunk/libsys-syslog-perl/Makefile.PL Tue Sep 18 05:59:46 2007
@@ -5,7 +5,7 @@
 use File::Copy;
 use File::Path;
 use File::Spec;
-require 5.006;
+require 5.005;
 
 
 # create a typemap for Perl 5.6
@@ -16,7 +16,7 @@
 }
 
 # create a lib/ dir in order to avoid warnings in Test::Distribution
-mkdir "lib";
+mkdir "lib", 0755;
 
 # virtual paths given to EU::MM
 my %virtual_path = ( 'Syslog.pm' => '$(INST_LIBDIR)/Syslog.pm' );
@@ -104,6 +104,10 @@
     # Mac OS X puts it at a different path.
     $_PATH_LOG = "/var/run/syslog";
 }
+elsif (-p "/dev/log" and -w _) {
+    # 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 _) {
     # Most unixes have a unix domain socket /dev/log.
     $_PATH_LOG = "/dev/log";

Modified: trunk/libsys-syslog-perl/README.win32
URL: http://svn.debian.org/wsvn/trunk/libsys-syslog-perl/README.win32?rev=7685&op=diff
==============================================================================
--- trunk/libsys-syslog-perl/README.win32 (original)
+++ trunk/libsys-syslog-perl/README.win32 Tue Sep 18 05:59:46 2007
@@ -1,30 +1,30 @@
-NAME
-
-    README.win32 - Customise and build Sys::Syslog with Win32 EventLog support
-
-
-DESCRIPTION
-
-    This package includes support for the Win32 Event log.  This requires 
-    building a message file and then compiling it and linking it into the 
-    final .DLL produced by MakeMaker.  The default message text file used 
-    by Sys::Syslog is PerlLog.mc, located in the win32/ subdirectory.
-
-    If the message file is updated then you need to go in the win32/ 
-    subdirectory and run the "compile.pl" command to update the relevent 
-    files. Note that Sys::Syslog::Win32 is built by this process.
-
-    The following files are in the win32 directory:
-
-        PerlLog.mc  -- Message file, change this if you change anything.
-        compile.pl  -- Compile the message file and produce Win32.pm and 
-                       PerlLog.RES. Requires that mc.exe and rc.exe are 
-                       in the path.
-
-        PerlLog.RES -- Precompiled resource file, used when building the DLL
-        Win32.pm    -- Generated Win32 module for working with the resource file
-
-    When building win32/PerlLog.RES will be linked into the final XS file, 
-    and win32/Win32.pm will be copied to lib/Sys/Syslog/Win32.pm, which will
-    then be installed by MakeMaker as per normal.
-
+NAME
+
+    README.win32 - Customise and build Sys::Syslog with Win32 EventLog support
+
+
+DESCRIPTION
+
+    This package includes support for the Win32 Event log.  This requires 
+    building a message file and then compiling it and linking it into the 
+    final .DLL produced by MakeMaker.  The default message text file used 
+    by Sys::Syslog is PerlLog.mc, located in the win32/ subdirectory.
+
+    If the message file is updated then you need to go in the win32/ 
+    subdirectory and run the "compile.pl" command to update the relevent 
+    files. Note that Sys::Syslog::Win32 is built by this process.
+
+    The following files are in the win32 directory:
+
+        PerlLog.mc  -- Message file, change this if you change anything.
+        compile.pl  -- Compile the message file and produce Win32.pm and 
+                       PerlLog.RES. Requires that mc.exe and rc.exe are 
+                       in the path.
+
+        PerlLog.RES -- Precompiled resource file, used when building the DLL
+        Win32.pm    -- Generated Win32 module for working with the resource file
+
+    When building win32/PerlLog.RES will be linked into the final XS file, 
+    and win32/Win32.pm will be copied to lib/Sys/Syslog/Win32.pm, which will
+    then be installed by MakeMaker as per normal.
+

Modified: trunk/libsys-syslog-perl/Syslog.pm
URL: http://svn.debian.org/wsvn/trunk/libsys-syslog-perl/Syslog.pm?rev=7685&op=diff
==============================================================================
--- trunk/libsys-syslog-perl/Syslog.pm (original)
+++ trunk/libsys-syslog-perl/Syslog.pm Tue Sep 18 05:59:46 2007
@@ -6,11 +6,11 @@
 use File::Basename;
 use POSIX qw(strftime setlocale LC_TIME);
 use Socket ':all';
-require 5.006;
+require 5.005;
 require Exporter;
 
 {   no strict 'vars';
-    $VERSION = '0.20';
+    $VERSION = '0.21';
     @ISA = qw(Exporter);
 
     %EXPORT_TAGS = (
@@ -98,8 +98,8 @@
 );
 
 # Default is now to first use the native mechanism, so Perl programs 
-# behave like other normal C programs, then try other mechanisms.
-my @connectMethods = qw(native tcp udp unix stream console);
+# behave like other normal Unix programs, then try other mechanisms.
+my @connectMethods = qw(native tcp udp unix pipe stream console);
 if ($^O =~ /^(freebsd|linux)$/) {
     @connectMethods = grep { $_ ne 'udp' } @connectMethods;
 }
@@ -212,6 +212,20 @@
 	    return undef;
         }
 
+    } elsif (lc $setsock eq 'pipe') {
+        for my $path ($syslog_path, &_PATH_LOG, "/dev/log") {
+            next unless defined $path and length $path and -w $path;
+            $syslog_path = $path;
+            last
+        }
+
+        if (not $syslog_path) {
+            warnings::warnif "pipe passed to setlogsock, but path not available";
+            return undef
+        }
+
+        @connectMethods = qw(pipe);
+
     } elsif (lc $setsock eq 'native') {
         @connectMethods = qw(native);
 
@@ -219,7 +233,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 operating system isn't Win32-compatible";
+            return undef;
         }
 
     } elsif (lc $setsock eq 'tcp') {
@@ -245,7 +260,8 @@
 	@connectMethods = qw(console);
 
     } else {
-        croak "Invalid argument passed to setlogsock; must be 'stream', 'unix', 'native', 'eventlog', 'tcp', 'udp' or 'inet'"
+        croak "Invalid argument passed to setlogsock; must be 'stream', 'pipe', ",
+              "'unix', 'native', 'eventlog', 'tcp', 'udp' or 'inet'"
     }
 
     return 1;
@@ -309,7 +325,10 @@
     $mask .= "\n" unless $mask =~ /\n$/;
     $message = @_ ? sprintf($mask, @_) : $mask;
 
-    if($current_proto eq 'native') {
+    # See CPAN-RT#24431. Opened on Apple Radar as bug #4944407 on 2007.01.21
+    chomp $message if $^O =~ /darwin/;
+
+    if ($current_proto eq 'native') {
         $buf = $message;
 
     }
@@ -405,6 +424,11 @@
     return syswrite(SYSLOG, $buf, length($buf));
 }
 
+sub _syslog_send_pipe {
+    my ($buf) = @_;
+    return print SYSLOG $buf;
+}
+
 sub _syslog_send_socket {
     my ($buf) = @_;
     return syswrite(SYSLOG, $buf, length($buf));
@@ -504,7 +528,10 @@
     }
 
     setsockopt(SYSLOG, SOL_SOCKET, SO_KEEPALIVE, 1);
-    setsockopt(SYSLOG, IPPROTO_TCP, TCP_NODELAY, 1);
+    if (eval { IPPROTO_TCP() }) {
+        # 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;
@@ -578,6 +605,26 @@
 	return 0;
     }
     $syslog_send = \&_syslog_send_stream;
+    return 1;
+}
+
+sub connect_pipe {
+    my ($errs) = @_;
+
+    $syslog_path ||= &_PATH_LOG || "/dev/log";
+
+    if (not -w $syslog_path) {
+        push @$errs, "$syslog_path is not writable";
+        return 0;
+    }
+
+    if (not open(SYSLOG, ">$syslog_path")) {
+        push @$errs, "can't write to $syslog_path: $!";
+        return 0;
+    }
+
+    $syslog_send = \&_syslog_send_pipe;
+
     return 1;
 }
 
@@ -705,7 +752,7 @@
 
 =head1 VERSION
 
-Version 0.20
+Version 0.21
 
 =head1 SYNOPSIS
 
@@ -907,6 +954,11 @@
 
 =item *
 
+C<"eventlog"> - send messages to the Win32 events logger (Win32 only; 
+added in C<Sys::Syslog> 0.19).
+
+=item *
+
 C<"tcp"> - connect to a TCP socket, on the C<syslog/tcp> or C<syslogng/tcp> 
 service. 
 
@@ -934,13 +986,15 @@
 
 =item *
 
+C<"pipe"> - connect to the named pipe indicated by the pathname provided as 
+the optional second parameter, or, if omitted, to the value returned by 
+the C<_PATH_LOG> macro (if your system defines it), or F</dev/log>
+(added in C<Sys::Syslog> 0.21).
+
+=item *
+
 C<"console"> - send messages directly to the console, as for the C<"cons"> 
 option of C<openlog()>.
-
-=item *
-
-C<"eventlog"> - send messages to the Win32 events logger (Win32 only; 
-added in C<Sys::Syslog> 0.19).
 
 =back
 
@@ -949,6 +1003,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.
 
 Giving an invalid value for C<$sock_type> will C<croak>.
 
@@ -1268,7 +1324,7 @@
 L<http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?coll=0640&db=man&fname=3c+syslog>
 
 AIX 5L 5.3 documentation on syslog, 
-L<http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.doc/libs/basetrf2/syslog.htm>
+L<http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.basetechref/doc/basetrf2/syslog.htm>
 
 HP-UX 11i documentation on syslog, 
 L<http://docs.hp.com/en/B9106-90010/syslog.3C.html>
@@ -1430,4 +1486,17 @@
 
 - L<ftp://ftp.kiae.su/pub/unix/fido/>
 
+
+Links
+-----
+II12021: SYSLOGD HOWTO TCPIPINFO (z/OS, OS/390, MVS)
+- L<http://www-1.ibm.com/support/docview.wss?uid=isg1II12021>
+
+Getting the most out of the Event Viewer
+- L<http://www.codeproject.com/dotnet/evtvwr.asp?print=true>
+
+Log events to the Windows NT Event Log with JNI
+- L<http://www.javaworld.com/javaworld/jw-09-2001/jw-0928-ntmessages.html>
+
 =end comment
+

Modified: trunk/libsys-syslog-perl/Syslog.xs
URL: http://svn.debian.org/wsvn/trunk/libsys-syslog-perl/Syslog.xs?rev=7685&op=diff
==============================================================================
--- trunk/libsys-syslog-perl/Syslog.xs (original)
+++ trunk/libsys-syslog-perl/Syslog.xs Tue Sep 18 05:59:46 2007
@@ -9,7 +9,7 @@
 #define HAVE_SYSLOG 1
 #endif
 
-#ifdef I_SYSLOG
+#if defined(I_SYSLOG) || PATCHLEVEL < 6
 #include <syslog.h>
 #endif
 

Modified: trunk/libsys-syslog-perl/debian/changelog
URL: http://svn.debian.org/wsvn/trunk/libsys-syslog-perl/debian/changelog?rev=7685&op=diff
==============================================================================
--- trunk/libsys-syslog-perl/debian/changelog (original)
+++ trunk/libsys-syslog-perl/debian/changelog Tue Sep 18 05:59:46 2007
@@ -1,3 +1,9 @@
+libsys-syslog-perl (0.21-1) UNRELEASED; urgency=low
+
+  * New upstream release
+
+ -- Damyan Ivanov <dmn at debian.org>  Tue, 18 Sep 2007 08:59:34 +0300
+
 libsys-syslog-perl (0.20-1) UNRELEASED; urgency=low
 
   * New upstream release

Modified: trunk/libsys-syslog-perl/t/syslog.t
URL: http://svn.debian.org/wsvn/trunk/libsys-syslog-perl/t/syslog.t?rev=7685&op=diff
==============================================================================
--- trunk/libsys-syslog-perl/t/syslog.t (original)
+++ trunk/libsys-syslog-perl/t/syslog.t Tue Sep 18 05:59:46 2007
@@ -111,13 +111,13 @@
 }
 
 
-BEGIN { $tests += 20 * 7 }
+BEGIN { $tests += 20 * 8 }
 # try to open a syslog using all the available connection methods
 my @passed = ();
-for my $sock_type (qw(native eventlog unix stream inet tcp udp)) {
+for my $sock_type (qw(native eventlog unix pipe stream inet tcp udp)) {
     SKIP: {
-        skip "the 'unix' mechanism works, so the tests will likely fail with the 'stream' mechanism", 20 
-            if $sock_type eq 'stream' and grep {/unix/} @passed;
+        skip "the 'stream' mechanism because a previous mechanism with similar interface succeeded", 20 
+            if $sock_type eq 'stream' and grep {/pipe|unix/} @passed;
 
         # setlogsock() called with an arrayref
         $r = eval { setlogsock([$sock_type]) } || 0;




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