In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/e57ea7c96db404b6101973609a00a22aa8bce9c3?hp=24963b0a8d4dddbe29a3709011cab46fdc3deee1>
- Log ----------------------------------------------------------------- commit e57ea7c96db404b6101973609a00a22aa8bce9c3 Author: Chris 'BinGOs' Williams <[email protected]> Date: Tue May 17 13:37:52 2016 +0100 Update Sys-Syslog to CPAN version 0.34 [DELTA] 0.34 -- 2016.05.06 -- Sebastien Aperghis-Tramoni (SAPER) [BUGFIX] CPAN-RT#105117: use %e where available, fall back to %d and a regexp where not (Markus Laker). [BUGFIX] CPAN-RT#98446: trailing new line with perror (Alexander Bluhm). [BUGFIX] CPAN-RT#105152: the noeol option was ignored (Markus Laker). [PORT] CPAN-RT#104710: loadable library and perl binaries are mismatched, because of missing CCFLAGS (CHORNY, KMX). [PORT] No longer inheriting from Exporter doesn't work before Perl 5.8.3. [BUGFIX] CPAN-RT#90538: facility from openlog() is not used (Anton Yuzhaninov). [PORT] CPAN-RT#90212: Support non-Windows platforms where syslog.h is not defined (Brian Fraser). [PORT] CPAN-RT#90224: setlocale() is not available everywhere, for example on Android (Brian Fraser). [PORT] CPAN-RT#90218: getproto*() and getserv*() functions are not available everywhere (Brian Fraser). [DOC] CPAN-RT#102058: mention the repository in the documentation. M Porting/Maintainers.pl M cpan/Sys-Syslog/Makefile.PL M cpan/Sys-Syslog/Syslog.pm M cpan/Sys-Syslog/Syslog.xs commit 05465a2f07dfa2d935435b71d3245be3c1b851dd Author: Chris 'BinGOs' Williams <[email protected]> Date: Tue May 17 13:35:33 2016 +0100 Update Term-ANSIColor to CPAN version 4.05 [DELTA] Term::ANSIColor 4.05 (2016-03-20) Color aliases are now restricted to ASCII alphanumerics, due to the below change. Delay loading of the Carp module and avoid using [:upper:], \w, and \d in regular expressions to reduce the amount of memory this module consumes. (Normally, I wouldn't worry about this, but this module is very light-weight and can be useful even in highly space-constrained environments, and the impact is slight.) Thanks, Nicolas R. (#111552) Provide a mailto address in bug tracking metadata, use the shorter form of the RT bug tracker URL, and fix the license value to match the new metadata specification. Rework Makefile.PL so that the munging for older versions of ExtUtils::MakeMaker is less intrusive. M Porting/Maintainers.pl M cpan/Term-ANSIColor/lib/Term/ANSIColor.pm M cpan/Term-ANSIColor/t/lib/Test/RRA.pm M cpan/Term-ANSIColor/t/lib/Test/RRA/Config.pm ----------------------------------------------------------------------- Summary of changes: Porting/Maintainers.pl | 4 +- cpan/Sys-Syslog/Makefile.PL | 3 +- cpan/Sys-Syslog/Syslog.pm | 129 +++++++++++++++---------- cpan/Sys-Syslog/Syslog.xs | 3 + cpan/Term-ANSIColor/lib/Term/ANSIColor.pm | 47 +++++++-- cpan/Term-ANSIColor/t/lib/Test/RRA.pm | 104 ++++++++------------ cpan/Term-ANSIColor/t/lib/Test/RRA/Config.pm | 138 ++++++++++++++------------- 7 files changed, 234 insertions(+), 194 deletions(-) diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index aa67507..9905417 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -1030,7 +1030,7 @@ use File::Glob qw(:case); }, 'Sys::Syslog' => { - 'DISTRIBUTION' => 'SAPER/Sys-Syslog-0.33.tar.gz', + 'DISTRIBUTION' => 'SAPER/Sys-Syslog-0.34.tar.gz', 'FILES' => q[cpan/Sys-Syslog], 'EXCLUDED' => [ qr{^eg/}, @@ -1047,7 +1047,7 @@ use File::Glob qw(:case); }, 'Term::ANSIColor' => { - 'DISTRIBUTION' => 'RRA/Term-ANSIColor-4.04.tar.gz', + 'DISTRIBUTION' => 'RRA/Term-ANSIColor-4.05.tar.gz', 'FILES' => q[cpan/Term-ANSIColor], 'EXCLUDED' => [ qr{^examples/}, diff --git a/cpan/Sys-Syslog/Makefile.PL b/cpan/Sys-Syslog/Makefile.PL index 347197a..d09ba69 100644 --- a/cpan/Sys-Syslog/Makefile.PL +++ b/cpan/Sys-Syslog/Makefile.PL @@ -3,6 +3,7 @@ use strict; use ExtUtils::MakeMaker; use File::Copy; use File::Spec; +use Config; # create a typemap for Perl 5.6 @@ -33,7 +34,7 @@ if ($^O =~ /Win32/) { $virtual_path{'win32/Win32.pm' } = '$(INST_LIBDIR)/Syslog/Win32.pm'; $virtual_path{'win32/PerlLog.dll'} = '$(INST_ARCHAUTODIR)/PerlLog.dll'; - push @extra_params, CCFLAGS => "-Ifallback"; + push @extra_params, CCFLAGS => "$Config{ccflags} -Ifallback"; # recreate the DLL from its uuencoded form if it's not here if (! -f File::Spec->catfile("win32", "$name.dll")) { diff --git a/cpan/Sys-Syslog/Syslog.pm b/cpan/Sys-Syslog/Syslog.pm index 25164af..0cfc749 100644 --- a/cpan/Sys-Syslog/Syslog.pm +++ b/cpan/Sys-Syslog/Syslog.pm @@ -3,15 +3,19 @@ use strict; use warnings; use warnings::register; use Carp; -use Exporter qw< import >; +use Config; +use Exporter (); use File::Basename; use POSIX qw< strftime setlocale LC_TIME >; use Socket qw< :all >; require 5.005; +*import = \&Exporter::import; + + { no strict 'vars'; - $VERSION = '0.33'; + $VERSION = '0.34'; %EXPORT_TAGS = ( standard => [qw(openlog syslog closelog setlogmask)], @@ -71,6 +75,29 @@ require 5.005; } +# +# Constants +# +use constant HAVE_GETPROTOBYNAME => $Config::Config{d_getpbyname}; +use constant HAVE_GETPROTOBYNUMBER => $Config::Config{d_getpbynumber}; +use constant HAVE_SETLOCALE => $Config::Config{d_setlocale}; +use constant HAVE_IPPROTO_TCP => defined &Socket::IPPROTO_TCP ? 1 : 0; +use constant HAVE_IPPROTO_UDP => defined &Socket::IPPROTO_UDP ? 1 : 0; +use constant HAVE_TCP_NODELAY => defined &Socket::TCP_NODELAY ? 1 : 0; + +use constant SOCKET_IPPROTO_TCP => + HAVE_IPPROTO_TCP ? Socket::IPPROTO_TCP + : HAVE_GETPROTOBYNAME ? scalar getprotobyname("tcp") + : 6; + +use constant SOCKET_IPPROTO_UDP => + HAVE_IPPROTO_UDP ? Socket::IPPROTO_UDP + : HAVE_GETPROTOBYNAME ? scalar getprotobyname("udp") + : 17; + +use constant SOCKET_TCP_NODELAY => HAVE_TCP_NODELAY ? Socket::TCP_NODELAY : 1; + + # # Public variables # @@ -241,7 +268,9 @@ my %mechanism = ( check => sub { return 1 if defined $sock_port; - if (getservbyname('syslog', 'tcp') || getservbyname('syslogng', 'tcp')) { + if (eval { local $SIG{__DIE__}; + getservbyname('syslog','tcp') || getservbyname('syslogng','tcp') + }) { $host = $syslog_path; return 1 } @@ -255,7 +284,7 @@ my %mechanism = ( check => sub { return 1 if defined $sock_port; - if (getservbyname('syslog', 'udp')) { + if (eval { local $SIG{__DIE__}; getservbyname('syslog', 'udp') }) { $host = $syslog_path; return 1 } @@ -366,6 +395,7 @@ sub syslog { if ($priority =~ /^\d+$/) { $numpri = LOG_PRI($priority); $numfac = LOG_FAC($priority) << 3; + undef $numfac if $numfac == 0; # no facility given => use default } elsif ($priority =~ /^\w+/) { # Allow "level" or "level|facility". @@ -419,7 +449,8 @@ sub syslog { $mask =~ s/(?<!%)((?:%%)*)%m/$1$error/g; } - $mask .= "\n" unless $mask =~ /\n$/; + # add (or not) a newline + $mask .= "\n" if !$options{noeol} and rindex($mask, "\n") == -1; $message = @args ? sprintf($mask, @args) : $mask; if ($current_proto eq 'native') { @@ -433,17 +464,27 @@ sub syslog { $whoami .= "[$$]" if $options{pid}; $sum = $numpri + $numfac; - my $oldlocale = setlocale(LC_TIME); - setlocale(LC_TIME, 'C'); - my $timestamp = strftime "%b %d %H:%M:%S", localtime; - setlocale(LC_TIME, $oldlocale); + + my $oldlocale; + if (HAVE_SETLOCALE) { + $oldlocale = setlocale(LC_TIME); + setlocale(LC_TIME, 'C'); + } + + # %e format isn't available on all systems (Win32, cf. CPAN RT #69310) + my $day = strftime "%e", localtime; + + if (index($day, "%") == 0) { + $day = strftime "%d", localtime; + $day =~ s/^0/ /; + } + + my $timestamp = strftime "%b $day %H:%M:%S", localtime; + setlocale(LC_TIME, $oldlocale) if HAVE_SETLOCALE; # construct the stream that will be transmitted $buf = "<$sum>$timestamp $whoami: $message"; - # add (or not) a newline - $buf .= "\n" if !$options{noeol} and rindex($buf, "\n") == -1; - # add (or not) a NUL character $buf .= "\0" if !$options{nonul}; } @@ -453,7 +494,8 @@ sub syslog { if ($options{perror} and $current_proto ne 'native') { my $whoami = $ident; $whoami .= "[$$]" if $options{pid}; - print STDERR "$whoami: $message\n"; + print STDERR "$whoami: $message"; + print STDERR "\n" if rindex($message, "\n") == -1; } # it's possible that we'll get an error from sending @@ -622,14 +664,9 @@ sub connect_log { sub connect_tcp { my ($errs) = @_; - my $proto = getprotobyname('tcp'); - if (!defined $proto) { - push @$errs, "getprotobyname failed for tcp"; - return 0; - } - - my $port = $sock_port || getservbyname('syslog', 'tcp'); - $port = getservbyname('syslogng', 'tcp') unless defined $port; + my $port = $sock_port + || eval { local $SIG{__DIE__}; getservbyname('syslog', 'tcp') } + || eval { local $SIG{__DIE__}; getservbyname('syslogng', 'tcp') }; if (!defined $port) { push @$errs, "getservbyname failed for syslog/tcp and syslogng/tcp"; return 0; @@ -647,16 +684,14 @@ sub connect_tcp { } $addr = sockaddr_in($port, $addr); - if (!socket(SYSLOG, AF_INET, SOCK_STREAM, $proto)) { + if (!socket(SYSLOG, AF_INET, SOCK_STREAM, SOCKET_IPPROTO_TCP)) { push @$errs, "tcp socket: $!"; return 0; } setsockopt(SYSLOG, SOL_SOCKET, SO_KEEPALIVE, 1); - if (silent_eval { IPPROTO_TCP() }) { - # These constants don't exist in 5.005. They were added in 1999 - setsockopt(SYSLOG, IPPROTO_TCP(), TCP_NODELAY(), 1); - } + setsockopt(SYSLOG, SOCKET_IPPROTO_TCP, SOCKET_TCP_NODELAY, 1); + if (!connect(SYSLOG, $addr)) { push @$errs, "tcp connect: $!"; return 0; @@ -670,13 +705,8 @@ sub connect_tcp { sub connect_udp { my ($errs) = @_; - my $proto = getprotobyname('udp'); - if (!defined $proto) { - push @$errs, "getprotobyname failed for udp"; - return 0; - } - - my $port = $sock_port || getservbyname('syslog', 'udp'); + my $port = $sock_port + || eval { local $SIG{__DIE__}; getservbyname('syslog', 'udp') }; if (!defined $port) { push @$errs, "getservbyname failed for syslog/udp"; return 0; @@ -694,7 +724,7 @@ sub connect_udp { } $addr = sockaddr_in($port, $addr); - if (!socket(SYSLOG, AF_INET, SOCK_DGRAM, $proto)) { + if (!socket(SYSLOG, AF_INET, SOCK_DGRAM, SOCKET_IPPROTO_UDP)) { push @$errs, "udp socket: $!"; return 0; } @@ -904,7 +934,7 @@ Sys::Syslog - Perl interface to the UNIX syslog(3) calls =head1 VERSION -This is the documentation of version 0.33 +This is the documentation of version 0.34 =head1 SYNOPSIS @@ -1665,34 +1695,37 @@ You can find documentation for this module with the perldoc command. You can also look for information at: -=over 4 - -=item * AnnoCPAN: Annotated CPAN documentation - -L<http://annocpan.org/dist/Sys-Syslog> +=over -=item * CPAN Ratings +=item * Perl Documentation -L<http://cpanratings.perl.org/d/Sys-Syslog> +L<http://perldoc.perl.org/Sys/Syslog.html> -=item * RT: CPAN's request tracker +=item * MetaCPAN -L<http://rt.cpan.org/Dist/Display.html?Queue=Sys-Syslog> +L<https://metacpan.org/module/Sys::Syslog> =item * Search CPAN L<http://search.cpan.org/dist/Sys-Syslog/> -=item * MetaCPAN +=item * AnnoCPAN: Annotated CPAN documentation -L<https://metacpan.org/module/Sys::Syslog> +L<http://annocpan.org/dist/Sys-Syslog> -=item * Perl Documentation +=item * CPAN Ratings -L<http://perldoc.perl.org/Sys/Syslog.html> +L<http://cpanratings.perl.org/d/Sys-Syslog> + +=item * RT: CPAN's request tracker + +L<http://rt.cpan.org/Dist/Display.html?Queue=Sys-Syslog> =back +The source code is available on Git Hub: +L<https://github.com/maddingue/Sys-Syslog/> + =head1 COPYRIGHT diff --git a/cpan/Sys-Syslog/Syslog.xs b/cpan/Sys-Syslog/Syslog.xs index d715b45..c802413 100644 --- a/cpan/Sys-Syslog/Syslog.xs +++ b/cpan/Sys-Syslog/Syslog.xs @@ -26,6 +26,9 @@ #else # if defined(I_SYSLOG) || PATCHLEVEL < 6 # include <syslog.h> +# else +# undef HAVE_SYSLOG +# include "fallback/syslog.h" # endif #endif diff --git a/cpan/Term-ANSIColor/lib/Term/ANSIColor.pm b/cpan/Term-ANSIColor/lib/Term/ANSIColor.pm index ace4d47..1a10edc 100644 --- a/cpan/Term-ANSIColor/lib/Term/ANSIColor.pm +++ b/cpan/Term-ANSIColor/lib/Term/ANSIColor.pm @@ -1,7 +1,7 @@ -# Term::ANSIColor -- Color screen output using ANSI escape sequences. +# Color screen output using ANSI escape sequences. # # Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2005, 2006, 2008, 2009, 2010, -# 2011, 2012, 2013, 2014, 2015 Russ Allbery <[email protected]> +# 2011, 2012, 2013, 2014, 2015, 2016 Russ Allbery <[email protected]> # Copyright 1996 Zenin # Copyright 2012 Kurt Starsinic <[email protected]> # @@ -23,7 +23,8 @@ use 5.006; use strict; use warnings; -use Carp qw(croak); +# Also uses Carp but loads it on demand to reduce memory usage. + use Exporter (); # use Exporter plus @ISA instead of use base for 5.6 compatibility. @@ -40,7 +41,7 @@ our $AUTOLOAD; # against circular module loading (not that we load any modules, but # consistency is good). BEGIN { - $VERSION = '4.04'; + $VERSION = '4.05'; # All of the basic supported constants, used in %EXPORT_TAGS. my @colorlist = qw( @@ -206,6 +207,17 @@ if (exists $ENV{ANSI_COLORS_ALIASES}) { # is global and therefore not threadsafe. our @COLORSTACK; +############################################################################## +# Helper functions +############################################################################## + +# Stub to load the Carp module on demand. +sub croak { + my (@args) = @_; + require Carp; + Carp::croak(@args); +} + ############################################################################## # Implementation (constant form) ############################################################################## @@ -233,10 +245,17 @@ our @COLORSTACK; # make it easier to write scripts that also work on systems without any ANSI # support, like Windows consoles. # +# Avoid using character classes like [:upper:] and \w here, since they load +# Unicode character tables and consume a ton of memory. All of our constants +# only use ASCII characters. +# ## no critic (ClassHierarchies::ProhibitAutoloading) ## no critic (Subroutines::RequireArgUnpacking) +## no critic (RegularExpressions::ProhibitEnumeratedClasses) sub AUTOLOAD { - my ($sub, $attr) = $AUTOLOAD =~ m{ \A ([\w:]*::([[:upper:]\d_]+)) \z }xms; + my ($sub, $attr) = $AUTOLOAD =~ m{ + \A ( [a-zA-Z0-9:]* :: ([A-Z0-9_]+) ) \z + }xms; # Check if we were called with something that doesn't look like an # attribute. @@ -295,7 +314,7 @@ sub AUTOLOAD { ## no critic (References::ProhibitDoubleSigils) goto &$AUTOLOAD; } -## use critic (Subroutines::RequireArgUnpacking) +## use critic # Append a new color to the top of the color stack and return the top of # the stack. @@ -501,13 +520,21 @@ sub coloralias { return $ATTRIBUTES_R{ $ALIASES{$alias} }; } } - if ($alias !~ m{ \A [\w._-]+ \z }xms) { + + # Avoid \w here to not load Unicode character tables, which increases the + # memory footprint of this module considerably. + # + ## no critic (RegularExpressions::ProhibitEnumeratedClasses) + if ($alias !~ m{ \A [a-zA-Z0-9._-]+ \z }xms) { croak(qq{Invalid alias name "$alias"}); } elsif ($ATTRIBUTES{$alias}) { croak(qq{Cannot alias standard color "$alias"}); } elsif (!exists $ATTRIBUTES{$color}) { croak(qq{Invalid attribute name "$color"}); } + ## use critic + + # Set the alias and return. $ALIASES{$alias} = $ATTRIBUTES{$color}; return $color; } @@ -793,8 +820,8 @@ If ATTR is specified, coloralias() sets up an alias of ALIAS for the standard color ATTR. From that point forward, ALIAS can be passed into color(), colored(), and colorvalid() and will have the same meaning as ATTR. One possible use of this facility is to give more meaningful names -to the 256-color RGB colors. Only alphanumerics, C<.>, C<_>, and C<-> are -allowed in alias names. +to the 256-color RGB colors. Only ASCII alphanumerics, C<.>, C<_>, and +C<-> are allowed in alias names. If ATTR is not specified, coloralias() returns the standard color name to which ALIAS is aliased, if any, or undef if ALIAS does not exist. @@ -1193,7 +1220,7 @@ voice solutions. Copyright 1996 Zenin Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2005, 2006, 2008, 2009, 2010, -2011, 2012, 2013, 2014, 2015 Russ Allbery <[email protected]> +2011, 2012, 2013, 2014, 2015, 2016 Russ Allbery <[email protected]> Copyright 2012 Kurt Starsinic <[email protected]> diff --git a/cpan/Term-ANSIColor/t/lib/Test/RRA.pm b/cpan/Term-ANSIColor/t/lib/Test/RRA.pm index 12be88b..5ac6eb8 100644 --- a/cpan/Term-ANSIColor/t/lib/Test/RRA.pm +++ b/cpan/Term-ANSIColor/t/lib/Test/RRA.pm @@ -5,31 +5,6 @@ # by both C packages with Automake and by stand-alone Perl modules. See # Test::RRA::Automake for additional functions specifically for C Automake # distributions. -# -# The canonical version of this file is maintained in the rra-c-util package, -# which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>. -# -# Written by Russ Allbery <[email protected]> -# Copyright 2013, 2014 -# The Board of Trustees of the Leland Stanford Junior University -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. package Test::RRA; @@ -56,7 +31,7 @@ BEGIN { # This version should match the corresponding rra-c-util release, but with # two digits for the minor version, including a leading zero if necessary, # so that it will sort properly. - $VERSION = '5.04'; + $VERSION = '5.11'; } # Skip this test unless author tests are requested. Takes a short description @@ -153,7 +128,7 @@ __END__ =for stopwords Allbery Allbery's DESC bareword sublicense MERCHANTABILITY NONINFRINGEMENT -rra-c-util +rra-c-util CPAN =head1 NAME @@ -176,46 +151,45 @@ Test::RRA - Support functions for Perl tests =head1 DESCRIPTION -This module collects utility functions that are useful for Perl test -scripts. It assumes Russ Allbery's Perl module layout and test -conventions and will only be useful for other people if they use the -same conventions. +This module collects utility functions that are useful for Perl test scripts. +It assumes Russ Allbery's Perl module layout and test conventions and will +only be useful for other people if they use the same conventions. =head1 FUNCTIONS -None of these functions are imported by default. The ones used by a -script should be explicitly imported. +None of these functions are imported by default. The ones used by a script +should be explicitly imported. =over 4 =item skip_unless_author(DESC) -Checks whether AUTHOR_TESTING is set in the environment and skips the -whole test (by calling C<plan skip_all> from Test::More) if it is not. -DESC is a description of the tests being skipped. A space and C<only run -for author> will be appended to it and used as the skip reason. +Checks whether AUTHOR_TESTING is set in the environment and skips the whole +test (by calling C<plan skip_all> from Test::More) if it is not. DESC is a +description of the tests being skipped. A space and C<only run for author> +will be appended to it and used as the skip reason. =item skip_unless_automated(DESC) -Checks whether AUTHOR_TESTING, AUTOMATED_TESTING, or RELEASE_TESTING are -set in the environment and skips the whole test (by calling C<plan -skip_all> from Test::More) if they are not. This should be used by tests -that should not run during end-user installs of the module, but which -should run as part of CPAN smoke testing and release testing. +Checks whether AUTHOR_TESTING, AUTOMATED_TESTING, or RELEASE_TESTING are set +in the environment and skips the whole test (by calling C<plan skip_all> from +Test::More) if they are not. This should be used by tests that should not run +during end-user installs of the module, but which should run as part of CPAN +smoke testing and release testing. DESC is a description of the tests being skipped. A space and C<normally skipped> will be appended to it and used as the skip reason. =item use_prereq(MODULE[, VERSION][, IMPORT ...]) -Attempts to load MODULE with the given VERSION and import arguments. If -this fails for any reason, the test will be skipped (by calling C<plan -skip_all> from Test::More) with a skip reason saying that MODULE is -required for the test. +Attempts to load MODULE with the given VERSION and import arguments. If this +fails for any reason, the test will be skipped (by calling C<plan skip_all> +from Test::More) with a skip reason saying that MODULE is required for the +test. VERSION will be passed to C<use> as a version bareword if it looks like a -version number. The remaining IMPORT arguments will be passed as the -value of an array. +version number. The remaining IMPORT arguments will be passed as the value of +an array. =back @@ -228,33 +202,33 @@ Russ Allbery <[email protected]> Copyright 2013, 2014 The Board of Trustees of the Leland Stanford Junior University -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. =head1 SEE ALSO Test::More(3), Test::RRA::Automake(3), Test::RRA::Config(3) -This module is maintained in the rra-c-util package. The current version -is available from L<http://www.eyrie.org/~eagle/software/rra-c-util/>. +This module is maintained in the rra-c-util package. The current version is +available from L<http://www.eyrie.org/~eagle/software/rra-c-util/>. -The functions to control when tests are run use environment variables -defined by the L<Lancaster +The functions to control when tests are run use environment variables defined +by the L<Lancaster Consensus|https://github.com/Perl-Toolchain-Gang/toolchain-site/blob/master/lancaster-consensus.md>. =cut diff --git a/cpan/Term-ANSIColor/t/lib/Test/RRA/Config.pm b/cpan/Term-ANSIColor/t/lib/Test/RRA/Config.pm index 6d41316..3110324 100644 --- a/cpan/Term-ANSIColor/t/lib/Test/RRA/Config.pm +++ b/cpan/Term-ANSIColor/t/lib/Test/RRA/Config.pm @@ -4,9 +4,6 @@ # configuration file to store some package-specific data. This module loads # that configuration and provides the namespace for the configuration # settings. -# -# The canonical version of this file is maintained in the rra-c-util package, -# which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>. package Test::RRA::Config; @@ -30,22 +27,23 @@ BEGIN { @ISA = qw(Exporter); @EXPORT_OK = qw( $COVERAGE_LEVEL @COVERAGE_SKIP_TESTS @CRITIC_IGNORE $LIBRARY_PATH - $MINIMUM_VERSION %MINIMUM_VERSION @POD_COVERAGE_EXCLUDE @STRICT_IGNORE - @STRICT_PREREQ + $MINIMUM_VERSION %MINIMUM_VERSION @MODULE_VERSION_IGNORE + @POD_COVERAGE_EXCLUDE @STRICT_IGNORE @STRICT_PREREQ ); # This version should match the corresponding rra-c-util release, but with # two digits for the minor version, including a leading zero if necessary, # so that it will sort properly. - $VERSION = '5.04'; + $VERSION = '5.11'; } # If BUILD or SOURCE are set in the environment, look for data/perl.conf under # those paths for a C Automake package. Otherwise, look in t/data/perl.conf -# for a standalone Perl module. Don't use Test::RRA::Automake since it may -# not exist. +# for a standalone Perl module or tests/data/perl.conf for Perl tests embedded +# in a larger distribution. Don't use Test::RRA::Automake since it may not +# exist. our $PATH; -for my $base ($ENV{BUILD}, $ENV{SOURCE}, 't') { +for my $base ($ENV{BUILD}, $ENV{SOURCE}, 't', 'tests') { next if !defined($base); my $path = "$base/data/perl.conf"; if (-r $path) { @@ -64,6 +62,7 @@ our @CRITIC_IGNORE; our $LIBRARY_PATH; our $MINIMUM_VERSION = '5.008'; our %MINIMUM_VERSION; +our @MODULE_VERSION_IGNORE; our @POD_COVERAGE_EXCLUDE; our @STRICT_IGNORE; our @STRICT_PREREQ; @@ -78,8 +77,8 @@ if (!do($PATH)) { __END__ =for stopwords -Allbery rra-c-util Automake perlcritic .libs namespace subdirectory -sublicense MERCHANTABILITY NONINFRINGEMENT +Allbery rra-c-util Automake perlcritic .libs namespace subdirectory sublicense +MERCHANTABILITY NONINFRINGEMENT regexes =head1 NAME @@ -92,19 +91,17 @@ Test::RRA::Config - Perl test configuration =head1 DESCRIPTION -Test::RRA::Config encapsulates per-package configuration for generic Perl -test programs that are shared between multiple packages using the -rra-c-util infrastructure. It handles locating and loading the test -configuration file for both C Automake packages and stand-alone Perl -modules. +Test::RRA::Config encapsulates per-package configuration for generic Perl test +programs that are shared between multiple packages using the rra-c-util +infrastructure. It handles locating and loading the test configuration file +for both C Automake packages and stand-alone Perl modules. Test::RRA::Config looks for a file named F<data/perl.conf> relative to the -root of the test directory. That root is taken from the environment -variables BUILD or SOURCE (in that order) if set, which will be the case -for C Automake packages using C TAP Harness. If neither is set, it -expects the root of the test directory to be a directory named F<t> -relative to the current directory, which will be the case for stand-alone -Perl modules. +root of the test directory. That root is taken from the environment variables +BUILD or SOURCE (in that order) if set, which will be the case for C Automake +packages using C TAP Harness. If neither is set, it expects the root of the +test directory to be a directory named F<t> relative to the current directory, +which will be the case for stand-alone Perl modules. The following variables are supported: @@ -112,70 +109,75 @@ The following variables are supported: =item $COVERAGE_LEVEL -The coverage level achieved by the test suite for Perl test coverage -testing using Test::Strict, as a percentage. The test will fail if test -coverage less than this percentage is achieved. If not given, defaults -to 100. +The coverage level achieved by the test suite for Perl test coverage testing +using Test::Strict, as a percentage. The test will fail if test coverage less +than this percentage is achieved. If not given, defaults to 100. =item @COVERAGE_SKIP_TESTS Directories under F<t> whose tests should be skipped when doing coverage -testing. This can be tests that won't contribute to coverage or tests -that don't run properly under Devel::Cover for some reason (such as ones -that use taint checking). F<docs> and F<style> will always be skipped -regardless of this setting. +testing. This can be tests that won't contribute to coverage or tests that +don't run properly under Devel::Cover for some reason (such as ones that use +taint checking). F<docs> and F<style> will always be skipped regardless of +this setting. =item @CRITIC_IGNORE -Additional directories to ignore when doing recursive perlcritic testing. -The contents of this directory must be either top-level directory names or +Additional directories to ignore when doing recursive perlcritic testing. The +contents of this directory must be either top-level directory names or directory names starting with F<tests/>. =item $LIBRARY_PATH Add this directory (or a F<.libs> subdirectory) relative to the top of the -source tree to LD_LIBRARY_PATH when checking the syntax of Perl modules. -This may be required to pick up libraries that are used by in-tree Perl -modules so that Perl scripts can pass a syntax check. +source tree to LD_LIBRARY_PATH when checking the syntax of Perl modules. This +may be required to pick up libraries that are used by in-tree Perl modules so +that Perl scripts can pass a syntax check. =item $MINIMUM_VERSION -Default minimum version requirement for included Perl scripts. If not -given, defaults to 5.008. +Default minimum version requirement for included Perl scripts. If not given, +defaults to 5.008. =item %MINIMUM_VERSION Minimum version exceptions for specific directories. The keys should be minimum versions of Perl to enforce. The value for each key should be a -reference to an array of either top-level directory names or directory -names starting with F<tests/>. All files in those directories will have -that minimum Perl version constraint imposed instead of $MINIMUM_VERSION. +reference to an array of either top-level directory names or directory names +starting with F<tests/>. All files in those directories will have that +minimum Perl version constraint imposed instead of $MINIMUM_VERSION. + +=item @MODULE_VERSION_IGNORE + +File names to ignore when checking that all modules in a distribution have the +same version. Sometimes, some specific modules need separate, special version +handling, such as modules defining database schemata for DBIx::Class, and +can't follow the version of the larger package. =item @POD_COVERAGE_EXCLUDE Regexes that match method names that should be excluded from POD coverage -testing. Normally, all methods have to be documented in the POD for a -Perl module, but methods matching any of these regexes will be considered -private and won't require documentation. +testing. Normally, all methods have to be documented in the POD for a Perl +module, but methods matching any of these regexes will be considered private +and won't require documentation. =item @STRICT_IGNORE -Additional directories to ignore when doing recursive Test::Strict testing -for C<use strict> and C<use warnings>. The contents of this directory -must be either top-level directory names or directory names starting with -F<tests/>. +Additional directories to ignore when doing recursive Test::Strict testing for +C<use strict> and C<use warnings>. The contents of this directory must be +either top-level directory names or directory names starting with F<tests/>. =item @STRICT_PREREQ A list of Perl modules that have to be available in order to do meaningful Test::Strict testing. If any of the modules cannot be loaded via C<use>, -Test::Strict checking will be skipped. There is currently no way to -require specific versions of the modules. +Test::Strict checking will be skipped. There is currently no way to require +specific versions of the modules. =back -No variables are exported by default, but the variables can be imported -into the local namespace to avoid long variable names. +No variables are exported by default, but the variables can be imported into +the local namespace to avoid long variable names. =head1 AUTHOR @@ -186,31 +188,31 @@ Russ Allbery <[email protected]> Copyright 2013, 2014 The Board of Trustees of the Leland Stanford Junior University -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. =head1 SEE ALSO -perlcritic(1), Test::MinimumVersion(3), Test::RRA(3), -Test::RRA::Automake(3), Test::Strict(3) +perlcritic(1), Test::MinimumVersion(3), Test::RRA(3), Test::RRA::Automake(3), +Test::Strict(3) -This module is maintained in the rra-c-util package. The current version -is available from L<http://www.eyrie.org/~eagle/software/rra-c-util/>. +This module is maintained in the rra-c-util package. The current version is +available from L<http://www.eyrie.org/~eagle/software/rra-c-util/>. The C TAP Harness test driver and libraries for TAP-based C testing are available from L<http://www.eyrie.org/~eagle/software/c-tap-harness/>. -- Perl5 Master Repository
