r35497 - in /trunk/libvariable-magic-perl: Changes META.yml Magic.xs Makefile.PL README debian/changelog lib/Variable/Magic.pm t/35-stash.t t/40-threads.t

ansgar-guest at users.alioth.debian.org ansgar-guest at users.alioth.debian.org
Sat May 16 07:44:17 UTC 2009


Author: ansgar-guest
Date: Sat May 16 07:44:12 2009
New Revision: 35497

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=35497
Log:
NO UPLOAD NEEDED: "This is a maintenance release. Users of 0.34 can skip
this update."

Modified:
    trunk/libvariable-magic-perl/Changes
    trunk/libvariable-magic-perl/META.yml
    trunk/libvariable-magic-perl/Magic.xs
    trunk/libvariable-magic-perl/Makefile.PL
    trunk/libvariable-magic-perl/README
    trunk/libvariable-magic-perl/debian/changelog
    trunk/libvariable-magic-perl/lib/Variable/Magic.pm
    trunk/libvariable-magic-perl/t/35-stash.t
    trunk/libvariable-magic-perl/t/40-threads.t

Modified: trunk/libvariable-magic-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libvariable-magic-perl/Changes?rev=35497&op=diff
==============================================================================
--- trunk/libvariable-magic-perl/Changes (original)
+++ trunk/libvariable-magic-perl/Changes Sat May 16 07:44:12 2009
@@ -1,4 +1,15 @@
 Revision history for Variable-Magic
+
+0.35    2009-05-15 20:50 UTC
+        This is a maintenance release. Users of 0.34 can skip this update.
+        + Chg : uvar magic used to be enabled for 5.9.5. It now requires 5.10 or
+                later.
+        + Fix : Silence compilation warnings for cxinc().
+        + Rem : The workaround introduced in 0.31 for the "Unknown errors" issue
+                was removed, as regression tests show that 0.34 provides a
+                better fix.
+        + Tst : Skip t/40-threads.t on 5.8.x with old versions of threads and
+                threads::shared.
 
 0.34    2009-04-19 16:55 UTC
         + Fix : Destruction of wizards in require.

Modified: trunk/libvariable-magic-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libvariable-magic-perl/META.yml?rev=35497&op=diff
==============================================================================
--- trunk/libvariable-magic-perl/META.yml (original)
+++ trunk/libvariable-magic-perl/META.yml Sat May 16 07:44:12 2009
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               Variable-Magic
-version:            0.34
+version:            0.35
 abstract:           Associate user-defined magic to variables from Perl.
 author:
     - Vincent Pit <perl at profvince.com>
@@ -23,7 +23,7 @@
     bugtracker:  http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Variable-Magic
     homepage:    http://search.cpan.org/dist/Variable-Magic/
     license:     http://dev.perl.org/licenses/
-    repository:  http://git.profvince.com/?p=perl/modules/Variable-Magic.git
+    repository:  http://git.profvince.com/?p=perl%2Fmodules%2FVariable-Magic.git
 no_index:
     directory:
         - t

Modified: trunk/libvariable-magic-perl/Magic.xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libvariable-magic-perl/Magic.xs?rev=35497&op=diff
==============================================================================
--- trunk/libvariable-magic-perl/Magic.xs (original)
+++ trunk/libvariable-magic-perl/Magic.xs Sat May 16 07:44:12 2009
@@ -135,8 +135,9 @@
 # endif
 #endif
 
-/* uvar magic and Hash::Util::FieldHash were commited with 28419 */
-#if VMG_HAS_PERL_MAINT(5, 9, 4, 28419) || VMG_HAS_PERL(5, 10, 0)
+/* uvar magic and Hash::Util::FieldHash were commited with 28419, but only
+ * enable it on 5.10 */
+#if VMG_HAS_PERL(5, 10, 0)
 # define VMG_UVAR 1
 #else
 # define VMG_UVAR 0
@@ -812,8 +813,9 @@
 
 STATIC int vmg_svt_free(pTHX_ SV *sv, MAGIC *mg) {
  const MGWIZ *w;
-#if VMG_HAS_PERL(5, 10, 0)
+#if VMG_HAS_PERL(5, 9, 5)
  PERL_CONTEXT saved_cx;
+ I32 cxix;
 #endif
  unsigned int had_err, has_err, flags = G_SCALAR | G_EVAL;
  int ret = 0;
@@ -852,19 +854,21 @@
  if (had_err)
   flags |= G_KEEPERR;
 
-#if VMG_HAS_PERL(5, 10, 0)
+#if VMG_HAS_PERL(5, 9, 5)
  /* This context should not be used anymore, but since we croak in places the
   * core doesn't even dare to, some pointers to it may remain in the upper call
   * stack. Make sure call_sv() doesn't clobber it. */
- if (cxstack_ix >= cxstack_max)
-  Perl_cxinc(aTHX);
- saved_cx = cxstack[cxstack_ix + 1];
+ if (cxstack_ix < cxstack_max)
+  cxix = cxstack_ix + 1;
+ else
+  cxix = Perl_cxinc(aTHX);
+ saved_cx = cxstack[cxix];
 #endif
 
  call_sv(w->cb_free, flags);
 
-#if VMG_HAS_PERL(5, 10, 0)
- cxstack[cxstack_ix + 1] = saved_cx;
+#if VMG_HAS_PERL(5, 9, 5)
+ cxstack[cxix] = saved_cx;
 #endif
 
  has_err = SvTRUE(ERRSV);
@@ -875,18 +879,6 @@
 
  FREETMPS;
  LEAVE;
-
- if (has_err) {
-  /* Get the eval context that was pushed by call_sv, and fake an entry for the
-   * namesv, as die_where will need it to be non NULL later */
-  PERL_CONTEXT *cx;
-  if (cxstack_ix >= cxstack_max)
-   Perl_cxinc(aTHX);
-  cx = cxstack + cxstack_ix + 1;
-  if (!cx->blk_eval.old_namesv)
-   cx->blk_eval.old_namesv
-                 = sv_2mortal(newSVpvn_share("Variable/Magic/DUMMY.pm", 23, 0));
- }
 
  /* Calling SvREFCNT_dec() will trigger destructors in an infinite loop, so
   * we have to rely on SvREFCNT() being a lvalue. Heck, even the core does it */

Modified: trunk/libvariable-magic-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libvariable-magic-perl/Makefile.PL?rev=35497&op=diff
==============================================================================
--- trunk/libvariable-magic-perl/Makefile.PL (original)
+++ trunk/libvariable-magic-perl/Makefile.PL Sat May 16 07:44:12 2009
@@ -60,7 +60,7 @@
   bugtracker => "http://rt.cpan.org/NoAuth/ReportBug.html?Queue=$dist",
   homepage   => "http://search.cpan.org/dist/$dist/",
   license    => 'http://dev.perl.org/licenses/',
-  repository => "http://git.profvince.com/?p=perl/modules/$dist.git",
+  repository => "http://git.profvince.com/?p=perl%2Fmodules%2F$dist.git",
  },
 );
 

Modified: trunk/libvariable-magic-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libvariable-magic-perl/README?rev=35497&op=diff
==============================================================================
--- trunk/libvariable-magic-perl/README (original)
+++ trunk/libvariable-magic-perl/README Sat May 16 07:44:12 2009
@@ -2,7 +2,7 @@
     Variable::Magic - Associate user-defined magic to variables from Perl.
 
 VERSION
-    Version 0.34
+    Version 0.35
 
 SYNOPSIS
         use Variable::Magic qw/wizard cast VMG_OP_INFO_NAME/;

Modified: trunk/libvariable-magic-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libvariable-magic-perl/debian/changelog?rev=35497&op=diff
==============================================================================
--- trunk/libvariable-magic-perl/debian/changelog (original)
+++ trunk/libvariable-magic-perl/debian/changelog Sat May 16 07:44:12 2009
@@ -1,3 +1,10 @@
+libvariable-magic-perl (0.35-1) UNRELEASED; urgency=low
+
+  NO UPLOAD NEEDED: "This is a maintenance release. Users of 0.34 can skip
+  this update."
+
+ -- Ansgar Burchardt <ansgar at 43-1.org>  Sat, 16 May 2009 09:43:30 +0200
+
 libvariable-magic-perl (0.34-1) unstable; urgency=low
 
   * New upstream release.

Modified: trunk/libvariable-magic-perl/lib/Variable/Magic.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libvariable-magic-perl/lib/Variable/Magic.pm?rev=35497&op=diff
==============================================================================
--- trunk/libvariable-magic-perl/lib/Variable/Magic.pm (original)
+++ trunk/libvariable-magic-perl/lib/Variable/Magic.pm Sat May 16 07:44:12 2009
@@ -13,13 +13,13 @@
 
 =head1 VERSION
 
-Version 0.34
+Version 0.35
 
 =cut
 
 our $VERSION;
 BEGIN {
- $VERSION = '0.34';
+ $VERSION = '0.35';
 }
 
 =head1 SYNOPSIS

Modified: trunk/libvariable-magic-perl/t/35-stash.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libvariable-magic-perl/t/35-stash.t?rev=35497&op=diff
==============================================================================
--- trunk/libvariable-magic-perl/t/35-stash.t (original)
+++ trunk/libvariable-magic-perl/t/35-stash.t Sat May 16 07:44:12 2009
@@ -9,7 +9,7 @@
 
 my $run;
 if (VMG_UVAR) {
- plan tests => 33;
+ plan tests => 41;
  $run = 1;
 } else {
  plan skip_all => 'uvar magic is required to test symbol table hooks';
@@ -109,6 +109,17 @@
 {
  local %mg;
 
+ eval q{ Hlagh->shoot() };
+
+ is $@, '', 'stash: second valid method call ran fine';
+ is_deeply \%mg, {
+  fetch => [ qw/shoot/ ],
+ }, 'stash: second valid method call';
+}
+
+{
+ local %mg;
+
  eval q{ my $meth = 'shoot'; Hlagh->$meth() };
 
  is $@, '', 'stash: valid dynamic method call ran fine';
@@ -124,13 +135,42 @@
   package Hlagher;
   our @ISA;
   BEGIN { @ISA = 'Hlagh' }
-  Hlagher->shoot()
+  Hlagher->leave()
  ];
 
  is $@, '', 'inherited valid method call ran fine';
  is_deeply \%mg, {
-  fetch => [ qw/ISA shoot/ ],
+  fetch => [ qw/ISA leave/ ],
  }, 'stash: inherited valid method call';
+}
+
+{
+ local %mg;
+
+ eval q{ Hlagher->leave() };
+
+ is $@, '', 'second inherited valid method call ran fine';
+ is_deeply \%mg, { }, 'stash: second inherited valid method call doesn\'t call magic';
+}
+
+{
+ local %mg;
+
+ eval q{ Hlagher->shoot() };
+
+ is $@, '', 'inherited previously called valid method call ran fine';
+ is_deeply \%mg, {
+  fetch => [ qw/shoot/ ],
+ }, 'stash: inherited previously called valid method call';
+}
+
+{
+ local %mg;
+
+ eval q{ Hlagher->shoot() };
+
+ is $@, '', 'second inherited previously called valid method call ran fine';
+ is_deeply \%mg, { }, 'stash: second inherited previously called valid method call doesn\'t call magic';
 }
 
 {

Modified: trunk/libvariable-magic-perl/t/40-threads.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libvariable-magic-perl/t/40-threads.t?rev=35497&op=diff
==============================================================================
--- trunk/libvariable-magic-perl/t/40-threads.t (original)
+++ trunk/libvariable-magic-perl/t/40-threads.t Sat May 16 07:44:12 2009
@@ -3,31 +3,36 @@
 use strict;
 use warnings;
 
+sub skipall {
+ my ($msg) = @_;
+ require Test::More;
+ Test::More::plan(skip_all => $msg);
+}
+
 use Config qw/%Config/;
 
 BEGIN {
- if (!$Config{useithreads}) {
-  require Test::More;
-  Test::More->import;
-  plan(skip_all => 'This perl wasn\'t built to support threads');
- }
+ my $t_v  = '1.67';
+ my $ts_v = '1.14';
+ skipall 'This perl wasn\'t built to support threads'
+                                                    unless $Config{useithreads};
+ skipall "threads $t_v required to test thread safety"
+                                              unless eval "use threads $t_v; 1";
+ skipall "threads::shared $ts_v required to test thread safety"
+                                     unless eval "use threads::shared $ts_v; 1";
 }
 
-use threads; # Before Test::More
-use threads::shared;
-
-use Test::More;
+use Test::More; # after threads
 
 use Variable::Magic qw/wizard cast dispell getdata VMG_THREADSAFE VMG_OP_INFO_NAME VMG_OP_INFO_OBJECT/;
 
-if (VMG_THREADSAFE) {
+BEGIN {
+ skipall 'This Variable::Magic isn\'t thread safe' unless VMG_THREADSAFE;
  plan tests => 2 * (4 * 18 + 1) + 2 * (4 * 13 + 1);
  my $v = $threads::VERSION;
  diag "Using threads $v" if defined $v;
  $v = $threads::shared::VERSION;
  diag "Using threads::shared $v" if defined $v;
-} else {
- plan skip_all => 'This Variable::Magic isn\'t thread safe';
 }
 
 my $destroyed : shared = 0;




More information about the Pkg-perl-cvs-commits mailing list