[pkg-nagios-changes] [Git][nagios-team/pkg-libmonitoring-livestatus-perl][upstream] New upstream version 0.80

Bas Couwenberg gitlab at salsa.debian.org
Sat May 5 19:00:29 BST 2018


Bas Couwenberg pushed to branch upstream at Debian Nagios Maintainer Group / pkg-libmonitoring-livestatus-perl


Commits:
4135c575 by Bas Couwenberg at 2018-05-05T19:25:13+02:00
New upstream version 0.80
- - - - -


18 changed files:

- Changes
- META.yml
- Makefile.PL
- inc/Module/AutoInstall.pm
- inc/Module/Install.pm
- inc/Module/Install/AutoInstall.pm
- inc/Module/Install/Base.pm
- inc/Module/Install/Can.pm
- inc/Module/Install/Fetch.pm
- inc/Module/Install/Include.pm
- inc/Module/Install/Makefile.pm
- inc/Module/Install/Metadata.pm
- inc/Module/Install/Win32.pm
- inc/Module/Install/WriteAll.pm
- lib/Monitoring/Livestatus.pm
- lib/Monitoring/Livestatus/INET.pm
- t/20-Monitoring-Livestatus-test_socket.t
- t/23-Monitoring-Livestatus-BigData.t


Changes:

=====================================
Changes
=====================================
--- a/Changes
+++ b/Changes
@@ -1,5 +1,9 @@
 Revision history for Perl extension Monitoring::Livestatus.
 
+0.80  Fri Jan 26 08:24:00 CET 2018
+	- support ipv6 connections
+	- change to Cpanel::JSON::XS
+
 0.78  Fri Dec 23 17:09:35 CET 2016
 	- fix spelling errors (#5)
 


=====================================
META.yml
=====================================
--- a/META.yml
+++ b/META.yml
@@ -8,7 +8,7 @@ configure_requires:
   ExtUtils::MakeMaker: 6.59
 distribution_type: module
 dynamic_config: 1
-generated_by: 'Module::Install version 1.14'
+generated_by: 'Module::Install version 1.17'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -20,11 +20,11 @@ no_index:
     - inc
     - t
 requires:
+  Cpanel::JSON::XS: 0
   Digest::MD5: 0
   Encode: 0
-  IO::Socket::INET: 0
+  IO::Socket::IP: 0
   IO::Socket::UNIX: 0
-  JSON::XS: 0
   Test::More: '0.87'
   perl: 5.6.0
   utf8: 0
@@ -33,4 +33,4 @@ resources:
   homepage: http://search.cpan.org/dist/Monitoring-Livestatus/
   license: http://dev.perl.org/licenses/
   repository: http://github.com/sni/Monitoring-Livestatus
-version: '0.78'
+version: '0.80'


=====================================
Makefile.PL
=====================================
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -15,12 +15,12 @@ resources(
 
 
 requires 'IO::Socket::UNIX';
-requires 'IO::Socket::INET';
+requires 'IO::Socket::IP';
 requires 'Digest::MD5';
 requires 'Test::More'        => '0.87';
 requires 'utf8';
 requires 'Encode';
-requires 'JSON::XS';
+requires 'Cpanel::JSON::XS';
 
 # test requirements
 # these requirements still make it into the META.yml, so they are commented so far


=====================================
inc/Module/AutoInstall.pm
=====================================
--- a/inc/Module/AutoInstall.pm
+++ b/inc/Module/AutoInstall.pm
@@ -8,7 +8,7 @@ use ExtUtils::MakeMaker ();
 
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '1.14';
+	$VERSION = '1.17';
 }
 
 # special map on pre-defined feature sets
@@ -537,7 +537,7 @@ sub _install_cpan {
     while ( my ( $opt, $arg ) = splice( @config, 0, 2 ) ) {
         ( $args{$opt} = $arg, next )
           if $opt =~ /^(?:force|notest)$/;    # pseudo-option
-        $CPAN::Config->{$opt} = $arg;
+        $CPAN::Config->{$opt} = $opt eq 'urllist' ? [$arg] : $arg;
     }
 
     if ($args{notest} && (not CPAN::Shell->can('notest'))) {


=====================================
inc/Module/Install.pm
=====================================
--- a/inc/Module/Install.pm
+++ b/inc/Module/Install.pm
@@ -31,7 +31,7 @@ BEGIN {
 	# This is not enforced yet, but will be some time in the next few
 	# releases once we can make sure it won't clash with custom
 	# Module::Install extensions.
-	$VERSION = '1.14';
+	$VERSION = '1.17';
 
 	# Storage for the pseudo-singleton
 	$MAIN    = undef;
@@ -244,6 +244,8 @@ sub new {
 	}
 	return $args{_self} if $args{_self};
 
+	$base_path = VMS::Filespec::unixify($base_path) if $^O eq 'VMS';
+
 	$args{dispatch} ||= 'Admin';
 	$args{prefix}   ||= 'inc';
 	$args{author}   ||= ($^O eq 'VMS' ? '_author' : '.author');
@@ -322,7 +324,7 @@ sub find_extensions {
 	my ($self, $path) = @_;
 
 	my @found;
-	File::Find::find( sub {
+	File::Find::find( {no_chdir => 1, wanted => sub {
 		my $file = $File::Find::name;
 		return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is;
 		my $subpath = $1;
@@ -336,7 +338,7 @@ sub find_extensions {
 		# correctly.  Otherwise, root through the file to locate the case-preserved
 		# version of the package name.
 		if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) {
-			my $content = Module::Install::_read($subpath . '.pm');
+			my $content = Module::Install::_read($File::Find::name);
 			my $in_pod  = 0;
 			foreach ( split /\n/, $content ) {
 				$in_pod = 1 if /^=\w/;
@@ -351,7 +353,7 @@ sub find_extensions {
 		}
 
 		push @found, [ $file, $pkg ];
-	}, $path ) if -d $path;
+	}}, $path ) if -d $path;
 
 	@found;
 }
@@ -373,8 +375,6 @@ sub _caller {
 	return $call;
 }
 
-# Done in evals to avoid confusing Perl::MinimumVersion
-eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
 sub _read {
 	local *FH;
 	open( FH, '<', $_[0] ) or die "open($_[0]): $!";
@@ -383,16 +383,6 @@ sub _read {
 	close FH or die "close($_[0]): $!";
 	return $string;
 }
-END_NEW
-sub _read {
-	local *FH;
-	open( FH, "< $_[0]"  ) or die "open($_[0]): $!";
-	binmode FH;
-	my $string = do { local $/; <FH> };
-	close FH or die "close($_[0]): $!";
-	return $string;
-}
-END_OLD
 
 sub _readperl {
 	my $string = Module::Install::_read($_[0]);
@@ -413,8 +403,6 @@ sub _readpod {
 	return $string;
 }
 
-# Done in evals to avoid confusing Perl::MinimumVersion
-eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
 sub _write {
 	local *FH;
 	open( FH, '>', $_[0] ) or die "open($_[0]): $!";
@@ -424,17 +412,6 @@ sub _write {
 	}
 	close FH or die "close($_[0]): $!";
 }
-END_NEW
-sub _write {
-	local *FH;
-	open( FH, "> $_[0]"  ) or die "open($_[0]): $!";
-	binmode FH;
-	foreach ( 1 .. $#_ ) {
-		print FH $_[$_] or die "print($_[0]): $!";
-	}
-	close FH or die "close($_[0]): $!";
-}
-END_OLD
 
 # _version is for processing module versions (eg, 1.03_05) not
 # Perl versions (eg, 5.8.1).


=====================================
inc/Module/Install/AutoInstall.pm
=====================================
--- a/inc/Module/Install/AutoInstall.pm
+++ b/inc/Module/Install/AutoInstall.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.14';
+	$VERSION = '1.17';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }


=====================================
inc/Module/Install/Base.pm
=====================================
--- a/inc/Module/Install/Base.pm
+++ b/inc/Module/Install/Base.pm
@@ -4,7 +4,7 @@ package Module::Install::Base;
 use strict 'vars';
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '1.14';
+	$VERSION = '1.17';
 }
 
 # Suspend handler for "redefined" warnings


=====================================
inc/Module/Install/Can.pm
=====================================
--- a/inc/Module/Install/Can.pm
+++ b/inc/Module/Install/Can.pm
@@ -8,7 +8,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.14';
+	$VERSION = '1.17';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -121,6 +121,15 @@ END_C
 # Can we locate a (the) C compiler
 sub can_cc {
 	my $self   = shift;
+
+	if ($^O eq 'VMS') {
+		require ExtUtils::CBuilder;
+		my $builder = ExtUtils::CBuilder->new(
+		quiet => 1,
+		);
+		return $builder->have_compiler;
+	}
+
 	my @chunks = split(/ /, $Config::Config{cc}) or return;
 
 	# $Config{cc} may contain args; try to find out the program part
@@ -151,4 +160,4 @@ if ( $^O eq 'cygwin' ) {
 
 __END__
 
-#line 236
+#line 245


=====================================
inc/Module/Install/Fetch.pm
=====================================
--- a/inc/Module/Install/Fetch.pm
+++ b/inc/Module/Install/Fetch.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.14';
+	$VERSION = '1.17';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }


=====================================
inc/Module/Install/Include.pm
=====================================
--- a/inc/Module/Install/Include.pm
+++ b/inc/Module/Install/Include.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.14';
+	$VERSION = '1.17';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }


=====================================
inc/Module/Install/Makefile.pm
=====================================
--- a/inc/Module/Install/Makefile.pm
+++ b/inc/Module/Install/Makefile.pm
@@ -8,7 +8,7 @@ use Fcntl qw/:flock :seek/;
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.14';
+	$VERSION = '1.17';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }


=====================================
inc/Module/Install/Metadata.pm
=====================================
--- a/inc/Module/Install/Metadata.pm
+++ b/inc/Module/Install/Metadata.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.14';
+	$VERSION = '1.17';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }


=====================================
inc/Module/Install/Win32.pm
=====================================
--- a/inc/Module/Install/Win32.pm
+++ b/inc/Module/Install/Win32.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.14';
+	$VERSION = '1.17';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }


=====================================
inc/Module/Install/WriteAll.pm
=====================================
--- a/inc/Module/Install/WriteAll.pm
+++ b/inc/Module/Install/WriteAll.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.14';
+	$VERSION = '1.17';
 	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
 }


=====================================
lib/Monitoring/Livestatus.pm
=====================================
--- a/lib/Monitoring/Livestatus.pm
+++ b/lib/Monitoring/Livestatus.pm
@@ -6,13 +6,13 @@ use warnings;
 use Data::Dumper qw/Dumper/;
 use Carp qw/carp croak confess/;
 use Digest::MD5 qw(md5_hex);
-use JSON::XS ();
+use Cpanel::JSON::XS ();
 use Storable qw/dclone/;
 
 use Monitoring::Livestatus::INET qw//;
 use Monitoring::Livestatus::UNIX qw//;
 
-our $VERSION = '0.78';
+our $VERSION = '0.80';
 
 
 # list of allowed options
@@ -856,7 +856,7 @@ sub _send {
     if($status == 200) {
         $result = $body;
     } else {
-        my $json_decoder = JSON::XS->new->utf8->relaxed;
+        my $json_decoder = Cpanel::JSON::XS->new->utf8->relaxed;
         # fix json output
         eval {
             $result = $json_decoder->decode($body);
@@ -1166,7 +1166,7 @@ sub _read_socket_do {
     if($json_decoder) {
         $json_decoder->incr_reset;
     } else {
-        $json_decoder = JSON::XS->new->utf8->relaxed;
+        $json_decoder = Cpanel::JSON::XS->new->utf8->relaxed;
     }
     if($content_length > 0) {
         if($status == 200) {
@@ -1188,6 +1188,9 @@ sub _read_socket_do {
     }
 
     $self->_close($sock) unless $self->{'keepalive'};
+    if($status >= 400 && $recv) {
+        $msg .= ' - '.$recv;
+    }
     return($status, $msg, $recv);
 }
 


=====================================
lib/Monitoring/Livestatus/INET.pm
=====================================
--- a/lib/Monitoring/Livestatus/INET.pm
+++ b/lib/Monitoring/Livestatus/INET.pm
@@ -3,7 +3,7 @@ use parent 'Monitoring::Livestatus';
 
 use strict;
 use warnings;
-use IO::Socket::INET ();
+use IO::Socket::IP ();
 use Socket qw(IPPROTO_TCP TCP_NODELAY);
 use Carp qw/confess croak/;
 
@@ -56,9 +56,9 @@ sub _open {
     my $remaining = alarm($self->{'connect_timeout'});
     eval {
         local $SIG{'ALRM'} = sub { die("connection timeout"); };
-        $sock = IO::Socket::INET->new(
+        $sock = IO::Socket::IP->new(
                                          PeerAddr => $self->{'peer'},
-                                         Type     => IO::Socket::INET::SOCK_STREAM,
+                                         Type     => IO::Socket::IP::SOCK_STREAM,
                                          Timeout  => $self->{'connect_timeout'},
                                          );
         if(!defined $sock || !$sock->connected()) {


=====================================
t/20-Monitoring-Livestatus-test_socket.t
=====================================
--- a/t/20-Monitoring-Livestatus-test_socket.t
+++ b/t/20-Monitoring-Livestatus-test_socket.t
@@ -6,7 +6,7 @@ use strict;
 use Test::More;
 use IO::Socket::UNIX qw( SOCK_STREAM SOMAXCONN );
 use Data::Dumper;
-use JSON::XS;
+use Cpanel::JSON::XS;
 
 BEGIN {
   eval {require threads;};
@@ -16,9 +16,6 @@ BEGIN {
   elsif( $^O eq 'MSWin32' ) {
       plan skip_all => 'no sockets on windows';
   }
-  elsif( $^V ge v5.22 ) {
-      plan skip_all => 'JSON::XS will not work in threaded perl >= 5.22';
-  }
   else{
     plan tests => 109
   }


=====================================
t/23-Monitoring-Livestatus-BigData.t
=====================================
--- a/t/23-Monitoring-Livestatus-BigData.t
+++ b/t/23-Monitoring-Livestatus-BigData.t
@@ -3,7 +3,27 @@
 #########################
 
 use strict;
-use Test::More tests => 13;
+
+my $netcat;
+BEGIN {
+    use Test::More;
+    for my $path (split(/:/mx, $ENV{'PATH'})) {
+        if(-x $path."/netcat") {
+            $netcat = $path."/netcat";
+            last;
+        }
+    }
+    if( $^O eq 'MSWin32' ) {
+        plan skip_all => 'no sockets on windows';
+    }
+    elsif(!$netcat) {
+        plan skip_all => 'no netcat found in path';
+    }
+    else {
+        plan tests => 13;
+    }
+};
+
 BEGIN { use_ok('Monitoring::Livestatus') };
 
 my $testport    = 60123;
@@ -41,8 +61,8 @@ ok($mem_start, sprintf('memory at start: %.2f MB', $mem_start/1024));
 
 ##########################################################
 # start netcat
-`netcat -vvv -w 3 -l -p $testport >/dev/null 2>&1 < $testfile &`;
-sleep(0.1);
+`$netcat -vvv -w 3 -l -p $testport >/dev/null 2>&1 < $testfile &`;
+sleep(1);
 ok(1, "netcat started");
 
 ##########################################################



View it on GitLab: https://salsa.debian.org/nagios-team/pkg-libmonitoring-livestatus-perl/commit/4135c575a731de94789bcfca10a7465a3b365fd6

---
View it on GitLab: https://salsa.debian.org/nagios-team/pkg-libmonitoring-livestatus-perl/commit/4135c575a731de94789bcfca10a7465a3b365fd6
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-nagios-changes/attachments/20180505/c061629b/attachment-0001.html>


More information about the pkg-nagios-changes mailing list