r21795 - in /branches/upstream/libsys-syslog-perl/current: Changes Makefile.PL Syslog.pm

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Tue Jun 17 15:40:30 UTC 2008


Author: gregoa
Date: Tue Jun 17 15:40:30 2008
New Revision: 21795

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

Modified:
    branches/upstream/libsys-syslog-perl/current/Changes
    branches/upstream/libsys-syslog-perl/current/Makefile.PL
    branches/upstream/libsys-syslog-perl/current/Syslog.pm

Modified: branches/upstream/libsys-syslog-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libsys-syslog-perl/current/Changes?rev=21795&op=diff
==============================================================================
--- branches/upstream/libsys-syslog-perl/current/Changes (original)
+++ branches/upstream/libsys-syslog-perl/current/Changes Tue Jun 17 15:40:30 2008
@@ -1,4 +1,9 @@
 Revision history for Sys-Syslog
+
+0.26 -- 2008.06.16 -- Sebastien Aperghis-Tramoni (SAPER)
+        [BUGFIX] Make Sys::Syslog works with Perl 5.10.0 (because of 
+        ExtUtils::Constant::ProxySubs).
+        [CODE] setlogsock() is now a little more strict about its arguments.
 
 0.25 -- 2008.05.17 -- Sebastien Aperghis-Tramoni (SAPER)
         [BUGFIX] CPAN-RT#34691: Fixed an incorrect call to sysopen() which
@@ -7,6 +12,7 @@
         [BUGFIX] CPAN-RT#34753: Fixed a slowness introduced in v0.19 (which 
         was to work around OSX syslog own slowness). Thanks to Alex Efros.
         [BUGFIX] CPAN-RT#35952: Fixed a bug with the "nofatal" option.
+        [BUGFIX] CPAN-RT#35189: Fixed a bug in xlate().
         [BUGFIX] Fixed build on Win32, thanks to Adam Kennedy.
         [FEATURE] setlogsock() now interprets the second argument as the 
         hostname for network mechanisms.

Modified: branches/upstream/libsys-syslog-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/branches/upstream/libsys-syslog-perl/current/Makefile.PL?rev=21795&op=diff
==============================================================================
--- branches/upstream/libsys-syslog-perl/current/Makefile.PL (original)
+++ branches/upstream/libsys-syslog-perl/current/Makefile.PL Tue Jun 17 15:40:30 2008
@@ -99,6 +99,7 @@
         # build/test prereqs
         'Test::More'        => 0,
     },
+    PL_FILES        => {},
     dist            => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
     clean           => { FILES => 'Sys-Syslog-*' }, 
     realclean       => { FILES => 'lib const-c.inc const-xs.inc macros.all '
@@ -178,9 +179,9 @@
     );
 
     ExtUtils::Constant::WriteConstants(
-        ($] > 5.009002 ? (PROXYSUBS => 1) : ()),
         NAME => 'Sys::Syslog',
         NAMES => [ @levels, @facilities, @options, @others_macros ],
+        ($] > 5.009002 ? (PROXYSUBS => 1) : ()),
     );
 
     my @names = map { ref $_ ? $_->{name} : $_ } @levels, @facilities, @options;

Modified: branches/upstream/libsys-syslog-perl/current/Syslog.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libsys-syslog-perl/current/Syslog.pm?rev=21795&op=diff
==============================================================================
--- branches/upstream/libsys-syslog-perl/current/Syslog.pm (original)
+++ branches/upstream/libsys-syslog-perl/current/Syslog.pm Tue Jun 17 15:40:30 2008
@@ -11,7 +11,7 @@
 require 5.005;
 
 {   no strict 'vars';
-    $VERSION = '0.25';
+    $VERSION = '0.26';
     @ISA = qw(Exporter);
 
     %EXPORT_TAGS = (
@@ -190,6 +190,13 @@
 sub setlogsock {
     my ($setsock, $setpath, $settime) = @_;
 
+    # check arguments
+    my $diag_invalid_arg
+        = "Invalid argument passed to setlogsock; must be 'stream', 'pipe', "
+        . "'unix', 'native', 'eventlog', 'tcp', 'udp' or 'inet'";
+    croak $diag_invalid_arg unless defined $setsock;
+    croak "Invalid number of arguments" unless @_ >= 1 and @_ <= 3;
+
     $syslog_path  = $setpath if defined $setpath;
     $sock_timeout = $settime if defined $settime;
 
@@ -289,8 +296,7 @@
 	@connectMethods = qw(console);
 
     } else {
-        croak "Invalid argument passed to setlogsock; must be 'stream', 'pipe', ",
-              "'unix', 'native', 'eventlog', 'tcp', 'udp' or 'inet'"
+        croak $diag_invalid_arg
     }
 
     return 1;
@@ -494,8 +500,22 @@
     return $name+0 if $name =~ /^\s*\d+\s*$/;
     $name = uc $name;
     $name = "LOG_$name" unless $name =~ /^LOG_/;
+
+    # ExtUtils::Constant 0.20 introduced a new way to implement
+    # constants, called ProxySubs.  When it was used to generate
+    # the C code, the constant() function no longer returns the 
+    # correct value.  Therefore, we first try a direct call to 
+    # constant(), and if the value is an error we try to call the 
+    # constant by its full name. 
     my $value = constant($name);
-    $value = -1 if $value =~ /not a valid/;
+
+    if (index($value, "not a valid") >= 0) {
+        $name = "Sys::Syslog::$name";
+        $value = eval { no strict "refs"; &$name };
+        $value = $@ unless defined $value;
+    }
+
+    $value = -1 if index($value, "not a valid") >= 0;
 
     return defined $value ? $value : -1;
 }
@@ -790,7 +810,7 @@
 #
 sub silent_eval (&) {
     local($SIG{__DIE__}, $SIG{__WARN__}, $@);
-    return eval $_[0]
+    return eval { $_[0]->() }
 }
 
 sub can_load {
@@ -809,7 +829,7 @@
 
 =head1 VERSION
 
-Version 0.25
+Version 0.26
 
 =head1 SYNOPSIS
 




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