r54388 - in /branches/upstream/libvariable-magic-perl/current: Changes MANIFEST META.yml Magic.xs README lib/Variable/Magic.pm

angelabad-guest at users.alioth.debian.org angelabad-guest at users.alioth.debian.org
Tue Mar 16 12:32:18 UTC 2010


Author: angelabad-guest
Date: Tue Mar 16 12:32:03 2010
New Revision: 54388

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=54388
Log:
[svn-upgrade] Integrating new upstream version, libvariable-magic-perl (0.41)

Modified:
    branches/upstream/libvariable-magic-perl/current/Changes
    branches/upstream/libvariable-magic-perl/current/MANIFEST
    branches/upstream/libvariable-magic-perl/current/META.yml
    branches/upstream/libvariable-magic-perl/current/Magic.xs
    branches/upstream/libvariable-magic-perl/current/README
    branches/upstream/libvariable-magic-perl/current/lib/Variable/Magic.pm

Modified: branches/upstream/libvariable-magic-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libvariable-magic-perl/current/Changes?rev=54388&op=diff
==============================================================================
--- branches/upstream/libvariable-magic-perl/current/Changes (original)
+++ branches/upstream/libvariable-magic-perl/current/Changes Tue Mar 16 12:32:03 2010
@@ -1,4 +1,12 @@
 Revision history for Variable-Magic
+
+0.41    2010-03-15 17:35 UTC
+        + Doc : Tweaks and fixups.
+                Thanks Shlomi Fish.
+        + Fix : Compatibility with the soon-to-be-released perl 5.12.0.
+        + Fix : Correctly propagate the errors thrown when variable destruction
+                happens at compile-time and not from inside eval STRING.
+                Thanks Florian Ragwitz and Ash Berlin for reporting.
 
 0.40    2010-01-06 23:20 UTC
         + Fix : Possible memory miswrites when passing data arguments to cast().

Modified: branches/upstream/libvariable-magic-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libvariable-magic-perl/current/MANIFEST?rev=54388&op=diff
==============================================================================
--- branches/upstream/libvariable-magic-perl/current/MANIFEST (original)
+++ branches/upstream/libvariable-magic-perl/current/MANIFEST Tue Mar 16 12:32:03 2010
@@ -1,6 +1,6 @@
 Changes
 MANIFEST
-META.yml # Will be created by "make dist"
+META.yml
 Magic.xs
 Makefile.PL
 README

Modified: branches/upstream/libvariable-magic-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libvariable-magic-perl/current/META.yml?rev=54388&op=diff
==============================================================================
--- branches/upstream/libvariable-magic-perl/current/META.yml (original)
+++ branches/upstream/libvariable-magic-perl/current/META.yml Tue Mar 16 12:32:03 2010
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               Variable-Magic
-version:            0.40
+version:            0.41
 abstract:           Associate user-defined magic to variables from Perl.
 author:
     - Vincent Pit <perl at profvince.com>

Modified: branches/upstream/libvariable-magic-perl/current/Magic.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libvariable-magic-perl/current/Magic.xs?rev=54388&op=diff
==============================================================================
--- branches/upstream/libvariable-magic-perl/current/Magic.xs (original)
+++ branches/upstream/libvariable-magic-perl/current/Magic.xs Tue Mar 16 12:32:03 2010
@@ -146,8 +146,8 @@
 # endif
 #endif
 
-/* uvar magic and Hash::Util::FieldHash were commited with 28419, but only
- * enable it on 5.10 */
+/* uvar magic and Hash::Util::FieldHash were commited with 28419, but we only
+ * enable them on 5.10 */
 #if VMG_HAS_PERL(5, 10, 0)
 # define VMG_UVAR 1
 #else
@@ -175,7 +175,7 @@
 #endif
 
 /* Applied to dev-5.11 as 34908 */
-#if VMG_HAS_PERL_MAINT(5, 11, 0, 34908)
+#if VMG_HAS_PERL_MAINT(5, 11, 0, 34908) || VMG_HAS_PERL(5, 12, 0)
 # define VMG_COMPAT_ARRAY_UNSHIFT_NOLEN_VOID 1
 #else
 # define VMG_COMPAT_ARRAY_UNSHIFT_NOLEN_VOID 0
@@ -188,7 +188,7 @@
 # define VMG_COMPAT_ARRAY_UNDEF_CLEAR 0
 #endif
 
-#if VMG_HAS_PERL_MAINT(5, 11, 0, 32969)
+#if VMG_HAS_PERL_MAINT(5, 11, 0, 32969) || VMG_HAS_PERL(5, 12, 0)
 # define VMG_COMPAT_SCALAR_LENGTH_NOLEN 1
 #else
 # define VMG_COMPAT_SCALAR_LENGTH_NOLEN 0
@@ -1058,7 +1058,7 @@
  /* So that it survives the temp cleanup below */
  SvREFCNT_inc_simple_void(sv);
 
-#if !VMG_HAS_PERL_MAINT(5, 11, 0, 32686)
+#if !(VMG_HAS_PERL_MAINT(5, 11, 0, 32686) || VMG_HAS_PERL(5, 12, 0))
  /* The previous magic tokens were freed but the magic chain wasn't updated, so
   * if you access the sv from the callback the old deleted magics will trigger
   * and cause memory misreads. Change 32686 solved it that way : */
@@ -1098,8 +1098,16 @@
 #endif
 
  has_err = SvTRUE(ERRSV);
- if (IN_PERL_COMPILETIME && !had_err && has_err)
-  ++PL_error_count;
+ if (IN_PERL_COMPILETIME && !had_err && has_err) {
+  if (PL_errors)
+   sv_catsv(PL_errors, ERRSV);
+  else
+   Perl_warn(aTHX_ "%s", SvPV_nolen(ERRSV));
+#ifdef PL_parser
+  if (PL_parser)
+#endif
+   ++PL_error_count;
+ }
 
  SPAGAIN;
  svr = POPs;
@@ -1121,7 +1129,7 @@
 
 #if MGf_COPY
 STATIC int vmg_svt_copy(pTHX_ SV *sv, MAGIC *mg, SV *nsv, const char *key,
-# if VMG_HAS_PERL_MAINT(5, 11, 0, 33256)
+# if VMG_HAS_PERL_MAINT(5, 11, 0, 33256) || VMG_HAS_PERL(5, 12, 0)
   I32 keylen
 # else
   int keylen

Modified: branches/upstream/libvariable-magic-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libvariable-magic-perl/current/README?rev=54388&op=diff
==============================================================================
--- branches/upstream/libvariable-magic-perl/current/README (original)
+++ branches/upstream/libvariable-magic-perl/current/README Tue Mar 16 12:32:03 2010
@@ -2,7 +2,7 @@
     Variable::Magic - Associate user-defined magic to variables from Perl.
 
 VERSION
-    Version 0.40
+    Version 0.41
 
 SYNOPSIS
         use Variable::Magic qw/wizard cast VMG_OP_INFO_NAME/;
@@ -30,8 +30,8 @@
         }
 
 DESCRIPTION
-    Magic is Perl way of enhancing objects. This mechanism lets the user add
-    extra data to any variable and hook syntaxical operations (such as
+    Magic is Perl's way of enhancing variables. This mechanism lets the user
+    add extra data to any variable and hook syntactical operations (such as
     access, assignment or destruction) that can be applied to it. With this
     module, you can add your own magic to any variable without having to
     write a single line of XS.
@@ -52,12 +52,12 @@
 
     *   It doesn't replace the original semantics.
 
-        Magic callbacks usually trigger before the original action take
-        place, and can't prevent it to happen. This also makes catching
-        individual events easier than with "tie", where you have to provide
-        fallbacks methods for all actions by usually inheriting from the
-        correct "Tie::Std*" class and overriding individual methods in your
-        own class.
+        Magic callbacks usually get triggered before the original action
+        takes place, and can't prevent it from happening. This also makes
+        catching individual events easier than with "tie", where you have to
+        provide fallbacks methods for all actions by usually inheriting from
+        the correct "Tie::Std*" class and overriding individual methods in
+        your own class.
 
     *   It's type-agnostic.
 
@@ -352,7 +352,9 @@
 
 COOKBOOK
   Associate an object to any perl variable
-    This can be useful for passing user data through limited APIs.
+    This technique can be useful for passing user data through limited APIs.
+    It is similar to using inside-out objects, but without the drawback of
+    having to implement a complex destructor.
 
         {
          package Magical::UserData;
@@ -365,9 +367,9 @@
           my ($var) = @_;
           my $data = &getdata($var, $wiz);
           unless (defined $data) {
-           &cast($var, $wiz);
-           $data = &getdata($var, $wiz);
-           die "Couldn't cast UserData magic onto the variable" unless defined $data;
+           $data = \(my $slot);
+           &cast($var, $wiz, $slot)
+                            or die "Couldn't cast UserData magic onto the variable";
           }
           $$data;
          }

Modified: branches/upstream/libvariable-magic-perl/current/lib/Variable/Magic.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libvariable-magic-perl/current/lib/Variable/Magic.pm?rev=54388&op=diff
==============================================================================
--- branches/upstream/libvariable-magic-perl/current/lib/Variable/Magic.pm (original)
+++ branches/upstream/libvariable-magic-perl/current/lib/Variable/Magic.pm Tue Mar 16 12:32:03 2010
@@ -13,13 +13,13 @@
 
 =head1 VERSION
 
-Version 0.40
+Version 0.41
 
 =cut
 
 our $VERSION;
 BEGIN {
- $VERSION = '0.40';
+ $VERSION = '0.41';
 }
 
 =head1 SYNOPSIS
@@ -50,8 +50,8 @@
 
 =head1 DESCRIPTION
 
-Magic is Perl way of enhancing objects.
-This mechanism lets the user add extra data to any variable and hook syntaxical operations (such as access, assignment or destruction) that can be applied to it.
+Magic is Perl's way of enhancing variables.
+This mechanism lets the user add extra data to any variable and hook syntactical operations (such as access, assignment or destruction) that can be applied to it.
 With this module, you can add your own magic to any variable without having to write a single line of XS.
 
 You'll realize that these magic variables look a lot like tied variables.
@@ -72,7 +72,7 @@
 
 It doesn't replace the original semantics.
 
-Magic callbacks usually trigger before the original action take place, and can't prevent it to happen.
+Magic callbacks usually get triggered before the original action takes place, and can't prevent it from happening.
 This also makes catching individual events easier than with C<tie>, where you have to provide fallbacks methods for all actions by usually inheriting from the correct C<Tie::Std*> class and overriding individual methods in your own class.
 
 =item *
@@ -417,7 +417,8 @@
 
 =head2 Associate an object to any perl variable
 
-This can be useful for passing user data through limited APIs.
+This technique can be useful for passing user data through limited APIs.
+It is similar to using inside-out objects, but without the drawback of having to implement a complex destructor.
 
     {
      package Magical::UserData;
@@ -430,9 +431,9 @@
       my ($var) = @_;
       my $data = &getdata($var, $wiz);
       unless (defined $data) {
-       &cast($var, $wiz);
-       $data = &getdata($var, $wiz);
-       die "Couldn't cast UserData magic onto the variable" unless defined $data;
+       $data = \(my $slot);
+       &cast($var, $wiz, $slot)
+                        or die "Couldn't cast UserData magic onto the variable";
       }
       $$data;
      }




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