Change 34058 by [EMAIL PROTECTED] on 2008/06/16 03:16:40
Subject: Fwd: CPAN Upload: S/SA/SAPER/Sys-Syslog-0.26.tar.gz
From: =?ISO-8859-1?Q?S=E9bastien_Aperghis-Tramoni?= <[EMAIL PROTECTED]>
Date: Mon, 16 Jun 2008 01:57:33 +0200
Message-Id: <[EMAIL PROTECTED]>
Affected files ...
... //depot/perl/ext/Sys/Syslog/Changes#17 edit
... //depot/perl/ext/Sys/Syslog/Makefile.PL#24 edit
... //depot/perl/ext/Sys/Syslog/Syslog.pm#58 edit
Differences ...
==== //depot/perl/ext/Sys/Syslog/Changes#17 (text) ====
Index: perl/ext/Sys/Syslog/Changes
--- perl/ext/Sys/Syslog/Changes#16~34005~ 2008-06-05 18:27:49.000000000
-0700
+++ perl/ext/Sys/Syslog/Changes 2008-06-15 20:16:40.000000000 -0700
@@ -1,5 +1,10 @@
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
prevented Sys::Syslog from working on some Solaris systems.
@@ -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.
==== //depot/perl/ext/Sys/Syslog/Makefile.PL#24 (text) ====
Index: perl/ext/Sys/Syslog/Makefile.PL
--- perl/ext/Sys/Syslog/Makefile.PL#23~34005~ 2008-06-05 18:27:49.000000000
-0700
+++ perl/ext/Sys/Syslog/Makefile.PL 2008-06-15 20:16:40.000000000 -0700
@@ -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;
==== //depot/perl/ext/Sys/Syslog/Syslog.pm#58 (text) ====
Index: perl/ext/Sys/Syslog/Syslog.pm
--- perl/ext/Sys/Syslog/Syslog.pm#57~34005~ 2008-06-05 18:27:49.000000000
-0700
+++ perl/ext/Sys/Syslog/Syslog.pm 2008-06-15 20:16:40.000000000 -0700
@@ -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
End of Patch.