Hello community, here is the log from the commit of package perl-Scope-Upper for openSUSE:Factory checked in at 2018-08-28 09:24:34 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Scope-Upper (Old) and /work/SRC/openSUSE:Factory/.perl-Scope-Upper.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Scope-Upper" Tue Aug 28 09:24:34 2018 rev:12 rq:631789 version:0.31 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Scope-Upper/perl-Scope-Upper.changes 2017-11-15 16:52:32.243602701 +0100 +++ /work/SRC/openSUSE:Factory/.perl-Scope-Upper.new/perl-Scope-Upper.changes 2018-08-28 09:24:35.408855296 +0200 @@ -1,0 +2,11 @@ +Mon Aug 27 06:02:36 UTC 2018 - [email protected] + +- updated to 0.31 + see /usr/share/doc/packages/perl-Scope-Upper/Changes + + 0.31 2018-08-26 19:50 UTC + + Fix : [RT #125931] : localized SCALAR doesn't get imported + localize '$Foo::x' => $var now properly imports $x into Foo. + Thanks Vernon Lyon for reporting. + +------------------------------------------------------------------- Old: ---- Scope-Upper-0.30.tar.gz New: ---- Scope-Upper-0.31.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Scope-Upper.spec ++++++ --- /var/tmp/diff_new_pack.j5w8GW/_old 2018-08-28 09:24:35.964857031 +0200 +++ /var/tmp/diff_new_pack.j5w8GW/_new 2018-08-28 09:24:35.968857043 +0200 @@ -1,7 +1,7 @@ # # spec file for package perl-Scope-Upper # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,11 +17,11 @@ Name: perl-Scope-Upper -Version: 0.30 +Version: 0.31 Release: 0 %define cpan_name Scope-Upper Summary: Act on upper scopes -License: Artistic-1.0 or GPL-1.0+ +License: Artistic-1.0 OR GPL-1.0-or-later Group: Development/Libraries/Perl Url: http://search.cpan.org/dist/Scope-Upper/ Source0: https://cpan.metacpan.org/authors/id/V/VP/VPIT/%{cpan_name}-%{version}.tar.gz ++++++ Scope-Upper-0.30.tar.gz -> Scope-Upper-0.31.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Scope-Upper-0.30/Changes new/Scope-Upper-0.31/Changes --- old/Scope-Upper-0.30/Changes 2017-11-04 16:46:07.000000000 +0100 +++ new/Scope-Upper-0.31/Changes 2018-08-26 21:30:47.000000000 +0200 @@ -1,5 +1,10 @@ Revision history for Scope-Upper +0.31 2018-08-26 19:50 UTC + + Fix : [RT #125931] : localized SCALAR doesn't get imported + localize '$Foo::x' => $var now properly imports $x into Foo. + Thanks Vernon Lyon for reporting. + 0.30 2017-11-04 15:55 UTC + Fix : [RT #123481] : Compatibility with CV-in-stash optimisation Thanks Father Chrysostomos for reporting and contributing a diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Scope-Upper-0.30/META.json new/Scope-Upper-0.31/META.json --- old/Scope-Upper-0.30/META.json 2017-11-04 16:46:31.000000000 +0100 +++ new/Scope-Upper-0.31/META.json 2018-08-26 21:31:43.000000000 +0200 @@ -4,7 +4,7 @@ "Vincent Pit <[email protected]>" ], "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 7.3, CPAN::Meta::Converter version 2.150010", + "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], @@ -59,6 +59,6 @@ "url" : "http://git.profvince.com/?p=perl%2Fmodules%2FScope-Upper.git" } }, - "version" : "0.30", - "x_serialization_backend" : "JSON::PP version 2.94" + "version" : "0.31", + "x_serialization_backend" : "JSON::PP version 2.97001" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Scope-Upper-0.30/META.yml new/Scope-Upper-0.31/META.yml --- old/Scope-Upper-0.30/META.yml 2017-11-04 16:46:31.000000000 +0100 +++ new/Scope-Upper-0.31/META.yml 2018-08-26 21:31:43.000000000 +0200 @@ -14,7 +14,7 @@ Config: '0' ExtUtils::MakeMaker: '0' dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 7.3, CPAN::Meta::Converter version 2.150010' +generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -34,5 +34,5 @@ homepage: http://search.cpan.org/dist/Scope-Upper/ license: http://dev.perl.org/licenses/ repository: http://git.profvince.com/?p=perl%2Fmodules%2FScope-Upper.git -version: '0.30' +version: '0.31' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Scope-Upper-0.30/README new/Scope-Upper-0.31/README --- old/Scope-Upper-0.30/README 2017-11-04 16:46:31.000000000 +0100 +++ new/Scope-Upper-0.31/README 2018-08-26 21:31:44.000000000 +0200 @@ -2,7 +2,7 @@ Scope::Upper - Act on upper scopes. VERSION - Version 0.30 + Version 0.31 SYNOPSIS "reap", "localize", "localize_elem", "localize_delete" and "WORDS" : @@ -823,8 +823,8 @@ Thanks to Shawn M. Moore for motivation. COPYRIGHT & LICENSE - Copyright 2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 Vincent Pit, - all rights reserved. + Copyright 2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 Vincent + Pit, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Scope-Upper-0.30/Upper.xs new/Scope-Upper-0.31/Upper.xs --- old/Scope-Upper-0.30/Upper.xs 2017-07-17 11:57:42.000000000 +0200 +++ new/Scope-Upper-0.31/Upper.xs 2018-08-26 21:09:25.000000000 +0200 @@ -808,25 +808,31 @@ static I32 su_ud_localize_init(pTHX_ su_ud_localize *ud, SV *sv, SV *val, SV *elem) { #define su_ud_localize_init(UD, S, V, E) su_ud_localize_init(aTHX_ (UD), (S), (V), (E)) - UV deref = 0; - svtype t = SVt_NULL; - I32 size; + int take_ref = 0; + svtype t = SVt_NULL; + I32 size; SvREFCNT_inc_simple_void(sv); if (SvTYPE(sv) >= SVt_PVGV) { + if (SvFAKE(sv)) { + sv_force_normal(sv); + goto string_spec; + } + if (!val || !SvROK(val)) { /* local *x; or local *x = $val; */ t = SVt_PVGV; } else { /* local *x = \$val; */ t = SvTYPE(SvRV(val)); - deref = 1; } } else if (SvROK(sv)) { croak("Invalid %s reference as the localization target", sv_reftype(SvRV(sv), 0)); } else { STRLEN len, l; - const char *p = SvPV_const(sv, len), *s; + const char *p, *s; +string_spec: + p = SvPV_const(sv, len); for (s = p, l = len; l > 0 && isSPACE(*s); ++s, --l) { } if (!l) { l = len; @@ -842,14 +848,17 @@ if (t != SVt_NULL) { ++s; --l; + if (t == SVt_PV) + take_ref = 1; } else if (val) { /* t == SVt_NULL, type can't be inferred from the sigil */ if (SvROK(val) && !sv_isobject(val)) { t = SvTYPE(SvRV(val)); - deref = 1; } else { t = SvTYPE(val); + take_ref = 1; } } + SvREFCNT_dec(sv); sv = newSVpvn(s, l); } @@ -858,31 +867,31 @@ case SVt_PVAV: size = elem ? SU_SAVE_AELEM_OR_ADELETE_SIZE : SU_SAVE_ARY_SIZE; - deref = 0; break; case SVt_PVHV: size = elem ? SU_SAVE_HELEM_OR_HDELETE_SIZE : SU_SAVE_HASH_SIZE; - deref = 0; break; case SVt_PVGV: size = SU_SAVE_GP_SIZE; - deref = 0; break; case SVt_PVCV: size = SU_SAVE_GVCV_SIZE; - deref = 0; break; default: size = SU_SAVE_SCALAR_SIZE; break; } - /* When deref is set, val isn't NULL */ SU_UD_PRIVATE(ud) = t; ud->sv = sv; - ud->val = val ? newSVsv(deref ? SvRV(val) : val) : NULL; + if (val) { + val = newSVsv(val); + ud->val = take_ref ? newRV_noinc(val) : val; + } else { + ud->val = NULL; + } ud->elem = SvREFCNT_inc(elem); return size; @@ -957,7 +966,7 @@ su_save_gvcv(gv); break; default: - gv = (GV *) save_scalar(gv); + save_scalar(gv); break; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Scope-Upper-0.30/lib/Scope/Upper.pm new/Scope-Upper-0.31/lib/Scope/Upper.pm --- old/Scope-Upper-0.30/lib/Scope/Upper.pm 2017-11-04 16:34:21.000000000 +0100 +++ new/Scope-Upper-0.31/lib/Scope/Upper.pm 2018-08-26 21:11:06.000000000 +0200 @@ -11,13 +11,13 @@ =head1 VERSION -Version 0.30 +Version 0.31 =cut our $VERSION; BEGIN { - $VERSION = '0.30'; + $VERSION = '0.31'; } =head1 SYNOPSIS @@ -865,7 +865,7 @@ =head1 COPYRIGHT & LICENSE -Copyright 2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 Vincent Pit, all rights reserved. +Copyright 2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 Vincent Pit, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Scope-Upper-0.30/t/20-localize-target.t new/Scope-Upper-0.31/t/20-localize-target.t --- old/Scope-Upper-0.30/t/20-localize-target.t 2015-03-12 13:55:48.000000000 +0100 +++ new/Scope-Upper-0.31/t/20-localize-target.t 2018-08-26 21:09:25.000000000 +0200 @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 70 + 4; +use Test::More tests => 70 + 2 * 5 + 4; use Scope::Upper qw<localize UP HERE>; @@ -333,6 +333,42 @@ is(Y->foo, 'X::foo', 'localize "Y::foo", sub { "Y::foo" } => UP [end]'); } +# Import + +sub is_imported { + my ($pkg, $sig, $val) = @_; + my $exp = $sig eq '$' ? \$val : $val; + my $var = 'daffodil'; # don't use 'x' or eval will capture $main::x + my $spec = $sig . $pkg . '::' . $var; + localize $spec, $val => HERE; + { + my $desc = "localize imported ${sig}${var} to $val"; + my $got = eval "package $pkg; \\${sig}${var}"; + if ($@) { + fail "$desc test did not compile: $@"; + } else { + is_deeply $got, $exp, $desc; + } + } + { + my $desc = "localize defined ${sig}${var} to $val"; + my $got = eval "\\${sig}${pkg}::${var}"; + if ($@) { + fail "$desc test did not compile: $@"; + } else { + is_deeply $got, $exp, $desc; + } + } +} + +{ + is_imported 'Scope::Upper::Test::Mock10', '$', 0; + is_imported 'Scope::Upper::Test::Mock11', '$', \1; + is_imported 'Scope::Upper::Test::Mock12', '@', [ 2, 3 ]; + is_imported 'Scope::Upper::Test::Mock13', '%', { a => 4 }; + is_imported 'Scope::Upper::Test::Mock14', '&', sub { 5 }; +} + # Invalid sub invalid_ref { qr/^Invalid \Q$_[0]\E reference as the localization target/ }
