In perl.git, the branch blead has been updated <https://perl5.git.perl.org/perl.git/commitdiff/7654aaa1134e4908a6a6dc0b85d360816e79faa3?hp=319c348f991497255fb1b6b90f92209af56c8904>
- Log ----------------------------------------------------------------- commit 7654aaa1134e4908a6a6dc0b85d360816e79faa3 Author: Chris 'BinGOs' Williams <[email protected]> Date: Sat Aug 17 18:38:54 2019 +0100 Revert "Update Scalar-List-Utils to CPAN version 1.51" This reverts commit 96684a73b5f81ca2a88309182dbc2dca9ab1601a. Failures with uselongdouble ----------------------------------------------------------------------- Summary of changes: Porting/Maintainers.pl | 2 +- cpan/Scalar-List-Utils/ListUtil.xs | 28 ++++++++-------------------- cpan/Scalar-List-Utils/lib/List/Util.pm | 12 ++---------- cpan/Scalar-List-Utils/lib/List/Util/XS.pm | 4 ++-- cpan/Scalar-List-Utils/lib/Scalar/Util.pm | 8 ++++---- cpan/Scalar-List-Utils/lib/Sub/Util.pm | 10 ++++------ cpan/Scalar-List-Utils/t/pair.t | 7 +------ cpan/Scalar-List-Utils/t/subname.t | 17 +---------------- cpan/Scalar-List-Utils/t/uniq.t | 25 ++----------------------- 9 files changed, 25 insertions(+), 88 deletions(-) diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index 390b987154..e3528c74e6 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -946,7 +946,7 @@ use File::Glob qw(:case); }, 'Scalar::Util' => { - 'DISTRIBUTION' => 'PEVANS/Scalar-List-Utils-1.51.tar.gz', + 'DISTRIBUTION' => 'PEVANS/Scalar-List-Utils-1.50.tar.gz', 'FILES' => q[cpan/Scalar-List-Utils], }, diff --git a/cpan/Scalar-List-Utils/ListUtil.xs b/cpan/Scalar-List-Utils/ListUtil.xs index d275df9c57..12f98cde19 100644 --- a/cpan/Scalar-List-Utils/ListUtil.xs +++ b/cpan/Scalar-List-Utils/ListUtil.xs @@ -1177,15 +1177,12 @@ CODE: /* clone the value so we don't invoke magic again */ arg = sv_mortalcopy(arg); - if(SvOK(arg) && !(SvUOK(arg) || SvIOK(arg) || SvNOK(arg))) - SvNV(arg); /* sets SVf_IOK/SVf_UOK if it's an integer */ - - if(!SvOK(arg) || SvUOK(arg)) + if(SvUOK(arg)) sv_setpvf(keysv, "%" UVuf, SvUV(arg)); else if(SvIOK(arg)) sv_setpvf(keysv, "%" IVdf, SvIV(arg)); else - sv_setpvf(keysv, "%.15" NVgf, SvNV(arg)); + sv_setpvf(keysv, "%" NVgf, SvNV(arg)); #ifdef HV_FETCH_EMPTY_HE he = (HE*) hv_common(seen, NULL, SvPVX(keysv), SvCUR(keysv), 0, HV_FETCH_LVALUE | HV_FETCH_EMPTY_HE, NULL, 0); if (HeVAL(he)) @@ -1604,18 +1601,15 @@ PPCODE: /* under debugger, provide information about sub location */ if (PL_DBsub && CvGV(cv)) { HV* DBsub = GvHV(PL_DBsub); - HE* old_data = NULL; + HE* old_data; GV* oldgv = CvGV(cv); HV* oldhv = GvSTASH(oldgv); + SV* old_full_name = sv_2mortal(newSVpvn_flags(HvNAME(oldhv), HvNAMELEN_get(oldhv), HvNAMEUTF8(oldhv) ? SVf_UTF8 : 0)); + sv_catpvn(old_full_name, "::", 2); + sv_catpvn_flags(old_full_name, GvNAME(oldgv), GvNAMELEN(oldgv), GvNAMEUTF8(oldgv) ? SV_CATUTF8 : SV_CATBYTES); - if (oldhv) { - SV* old_full_name = sv_2mortal(newSVpvn_flags(HvNAME(oldhv), HvNAMELEN_get(oldhv), HvNAMEUTF8(oldhv) ? SVf_UTF8 : 0)); - sv_catpvn(old_full_name, "::", 2); - sv_catpvn_flags(old_full_name, GvNAME(oldgv), GvNAMELEN(oldgv), GvNAMEUTF8(oldgv) ? SV_CATUTF8 : SV_CATBYTES); - - old_data = hv_fetch_ent(DBsub, old_full_name, 0, 0); - } + old_data = hv_fetch_ent(DBsub, old_full_name, 0, 0); if (old_data && HeVAL(old_data)) { SV* new_full_name = sv_2mortal(newSVpvn_flags(HvNAME(stash), HvNAMELEN_get(stash), HvNAMEUTF8(stash) ? SVf_UTF8 : 0)); @@ -1666,7 +1660,6 @@ subname(code) PREINIT: CV *cv; GV *gv; - const char *stashname; PPCODE: if (!SvROK(code) && SvGMAGICAL(code)) mg_get(code); @@ -1677,12 +1670,7 @@ PPCODE: if(!(gv = CvGV(cv))) XSRETURN(0); - if(GvSTASH(gv)) - stashname = HvNAME(GvSTASH(gv)); - else - stashname = "__ANON__"; - - mPUSHs(newSVpvf("%s::%s", stashname, GvNAME(gv))); + mPUSHs(newSVpvf("%s::%s", HvNAME(GvSTASH(gv)), GvNAME(gv))); XSRETURN(1); BOOT: diff --git a/cpan/Scalar-List-Utils/lib/List/Util.pm b/cpan/Scalar-List-Utils/lib/List/Util.pm index 678e024f8a..b650d3585a 100644 --- a/cpan/Scalar-List-Utils/lib/List/Util.pm +++ b/cpan/Scalar-List-Utils/lib/List/Util.pm @@ -15,9 +15,9 @@ our @EXPORT_OK = qw( all any first min max minstr maxstr none notall product reduce sum sum0 shuffle uniq uniqnum uniqstr head tail pairs unpairs pairkeys pairvalues pairmap pairgrep pairfirst ); -our $VERSION = "1.51"; +our $VERSION = "1.50"; our $XS_VERSION = $VERSION; -$VERSION =~ tr/_//d; +$VERSION = eval $VERSION; require XSLoader; XSLoader::load('List::Util', $XS_VERSION); @@ -38,7 +38,6 @@ sub import # For objects returned by pairs() sub List::Util::_Pair::key { shift->[0] } sub List::Util::_Pair::value { shift->[1] } -sub List::Util::_Pair::TO_JSON { [ @{+shift} ] } =head1 NAME @@ -342,9 +341,6 @@ equivalent: ... } -Since version C<1.51> they also have a C<TO_JSON> method to ease -serialisation. - =head2 unpairs my @kvlist = unpairs @pairs @@ -561,8 +557,6 @@ entire list of values returned by C<uniqstr> are well-behaved as strings. my @values = head $size, @list; -I<Since version 1.50.> - Returns the first C<$size> elements from C<@list>. If C<$size> is negative, returns all but the last C<$size> elements from C<@list>. @@ -576,8 +570,6 @@ all but the last C<$size> elements from C<@list>. my @values = tail $size, @list; -I<Since version 1.50.> - Returns the last C<$size> elements from C<@list>. If C<$size> is negative, returns all but the first C<$size> elements from C<@list>. diff --git a/cpan/Scalar-List-Utils/lib/List/Util/XS.pm b/cpan/Scalar-List-Utils/lib/List/Util/XS.pm index 35f03b3219..c8c066f825 100644 --- a/cpan/Scalar-List-Utils/lib/List/Util/XS.pm +++ b/cpan/Scalar-List-Utils/lib/List/Util/XS.pm @@ -3,8 +3,8 @@ use strict; use warnings; use List::Util; -our $VERSION = "1.51"; # FIXUP -$VERSION =~ tr/_//d; # FIXUP +our $VERSION = "1.50"; # FIXUP +$VERSION = eval $VERSION; # FIXUP 1; __END__ diff --git a/cpan/Scalar-List-Utils/lib/Scalar/Util.pm b/cpan/Scalar-List-Utils/lib/Scalar/Util.pm index 14ae8c979b..6982158705 100644 --- a/cpan/Scalar-List-Utils/lib/Scalar/Util.pm +++ b/cpan/Scalar-List-Utils/lib/Scalar/Util.pm @@ -17,8 +17,8 @@ our @EXPORT_OK = qw( dualvar isdual isvstring looks_like_number openhandle readonly set_prototype tainted ); -our $VERSION = "1.51"; -$VERSION =~ tr/_//d; +our $VERSION = "1.50"; +$VERSION = eval $VERSION; require List::Util; # List::Util loads the XS List::Util->VERSION( $VERSION ); # Ensure we got the right XS version (RT#100863) @@ -276,8 +276,8 @@ L<perlapi/looks_like_number>. my $fh = openhandle( $fh ); -Returns C<$fh> itself, if C<$fh> may be used as a filehandle and is open, or if -it is a tied handle. Otherwise C<undef> is returned. +Returns C<$fh> itself if C<$fh> may be used as a filehandle and is open, or is +is a tied handle. Otherwise C<undef> is returned. $fh = openhandle(*STDIN); # \*STDIN $fh = openhandle(\*STDIN); # \*STDIN diff --git a/cpan/Scalar-List-Utils/lib/Sub/Util.pm b/cpan/Scalar-List-Utils/lib/Sub/Util.pm index 91be87e24e..edcc6544f6 100644 --- a/cpan/Scalar-List-Utils/lib/Sub/Util.pm +++ b/cpan/Scalar-List-Utils/lib/Sub/Util.pm @@ -15,8 +15,8 @@ our @EXPORT_OK = qw( subname set_subname ); -our $VERSION = "1.51"; -$VERSION =~ tr/_//d; +our $VERSION = "1.50"; +$VERSION = eval $VERSION; require List::Util; # as it has the XS List::Util->VERSION( $VERSION ); # Ensure we got the right XS version (RT#100863) @@ -95,10 +95,8 @@ I<Since version 1.40.> Returns the name of the given C<$code> reference, if it has one. Normal named subs will give a fully-qualified name consisting of the package and the localname separated by C<::>. Anonymous code references will give C<__ANON__> -as the localname. If the package the code was compiled in has been deleted -(e.g. using C<delete_package> from L<Symbol>), C<__ANON__> will be returned as -the package name. If a name has been set using L</set_subname>, this name will be -returned instead. +as the localname. If a name has been set using L</set_subname>, this name will +be returned instead. This function was inspired by C<sub_fullname> from L<Sub::Identify>. The remaining functions that C<Sub::Identify> implements can easily be emulated diff --git a/cpan/Scalar-List-Utils/t/pair.t b/cpan/Scalar-List-Utils/t/pair.t index 7d7a6a9bb5..e65123cc2c 100644 --- a/cpan/Scalar-List-Utils/t/pair.t +++ b/cpan/Scalar-List-Utils/t/pair.t @@ -3,9 +3,8 @@ use strict; use warnings; -use Test::More tests => 29; +use Test::More tests => 27; use List::Util qw(pairgrep pairfirst pairmap pairs unpairs pairkeys pairvalues); -use Scalar::Util qw(blessed); no warnings 'misc'; # avoid "Odd number of elements" warnings most of the time @@ -105,10 +104,6 @@ is_deeply( [ pairs one => 1, two => ], my @p = pairs one => 1, two => 2; is( $p[0]->key, "one", 'pairs ->key' ); is( $p[0]->value, 1, 'pairs ->value' ); - is_deeply( $p[0]->TO_JSON, - [ one => 1 ], - 'pairs ->TO_JSON' ); - ok( !blessed($p[0]->TO_JSON) , 'pairs ->TO_JSON is not blessed' ); } is_deeply( [ unpairs [ four => 4 ], [ five => 5 ], [ six => 6 ] ], diff --git a/cpan/Scalar-List-Utils/t/subname.t b/cpan/Scalar-List-Utils/t/subname.t index c78a70043f..1bf8a9f698 100644 --- a/cpan/Scalar-List-Utils/t/subname.t +++ b/cpan/Scalar-List-Utils/t/subname.t @@ -3,11 +3,10 @@ use warnings; BEGIN { $^P |= 0x210 } -use Test::More tests => 21; +use Test::More tests => 18; use B::Deparse; use Sub::Util qw( subname set_subname ); -use Symbol qw( delete_package ) ; { sub localfunc {} @@ -79,18 +78,4 @@ is($x->(), "main::foo"); 'subname of set_subname'); } -# this used to segfault - -{ - sub ToDelete::foo {} - - my $foo = \&ToDelete::foo; - - delete_package 'ToDelete'; - - is( subname($foo), "$]" >= 5.010 ? '__ANON__::foo' : 'ToDelete::foo', 'subname in deleted package' ); - ok( set_subname('NewPackage::foo', $foo), 'rename from deleted package' ); - is( subname($foo), 'NewPackage::foo', 'subname after rename' ); -} - # vim: ft=perl diff --git a/cpan/Scalar-List-Utils/t/uniq.t b/cpan/Scalar-List-Utils/t/uniq.t index 8e76f21b9b..8806b8e7d7 100644 --- a/cpan/Scalar-List-Utils/t/uniq.t +++ b/cpan/Scalar-List-Utils/t/uniq.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 33; +use Test::More tests => 30; use List::Util qw( uniqnum uniqstr uniq ); use Tie::Array; @@ -75,18 +75,6 @@ is_deeply( [ uniqnum qw( 1 1.1 1.2 1.3 ) ], [ 1, 1.1, 1.2, 1.3 ], 'uniqnum distinguishes floats' ); -{ - my @nums = map $_+0.1, 1e7..1e7+5; - is_deeply( [ uniqnum @nums ], - [ @nums ], - 'uniqnum distinguishes large floats' ); - - my @strings = map "$_", @nums; - is_deeply( [ uniqnum @strings ], - [ @strings ], - 'uniqnum distinguishes large floats (stringified)' ); -} - # Hard to know for sure what an Inf is going to be. Lets make one my $Inf = 0 + 1E1000; my $NaN; @@ -96,7 +84,7 @@ is_deeply( [ uniqnum 0, 1, 12345, $Inf, -$Inf, $NaN, 0, $Inf, $NaN ], [ 0, 1, 12345, $Inf, -$Inf, $NaN ], 'uniqnum preserves the special values of +-Inf and Nan' ); -SKIP: { +{ my $maxuint = ~0; my $maxint = ~0 >> 1; my $minint = -(~0 >> 1) - 1; @@ -106,15 +94,6 @@ SKIP: { is_deeply( [ uniqnum @nums, 1.0 ], [ @nums ], 'uniqnum preserves uniqness of full integer range' ); - - my @strs = map "$_", @nums; - - skip( "Perl $] doesn't stringify UV_MAX right ($maxuint)", 1 ) - if $maxuint !~ /\A[0-9]+\z/; - - is_deeply( [ uniqnum @strs, "1.0" ], - [ @strs ], - 'uniqnum preserves uniqness of full integer range (stringified)' ); } { -- Perl5 Master Repository
