r35804 - in /trunk/libscope-upper-perl: Changes MANIFEST META.yml Makefile.PL README Upper.xs debian/changelog debian/control debian/copyright lib/Scope/Upper.pm t/01-import.t t/59-unwind-threads.t t/90-boilerplate.t

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Tue May 19 05:12:20 UTC 2009


Author: jawnsy-guest
Date: Tue May 19 05:12:14 2009
New Revision: 35804

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=35804
Log:
* New upstream release (NO RELEASE NECESSARY)
* Win32 compatibility fixes (with threading)
* New constant exported to see whether threading is available; it is
  on Debian, but not Win32 with Perls older than 5.8.
* Added some tests
* Very very minor (actually pretty much irrelevant) formatting changes
  to debian/control
* Added /me to Uploaders, but this might not even be necessary as this
  version is not being released

Removed:
    trunk/libscope-upper-perl/t/90-boilerplate.t
Modified:
    trunk/libscope-upper-perl/Changes
    trunk/libscope-upper-perl/MANIFEST
    trunk/libscope-upper-perl/META.yml
    trunk/libscope-upper-perl/Makefile.PL
    trunk/libscope-upper-perl/README
    trunk/libscope-upper-perl/Upper.xs
    trunk/libscope-upper-perl/debian/changelog
    trunk/libscope-upper-perl/debian/control
    trunk/libscope-upper-perl/debian/copyright
    trunk/libscope-upper-perl/lib/Scope/Upper.pm
    trunk/libscope-upper-perl/t/01-import.t
    trunk/libscope-upper-perl/t/59-unwind-threads.t

Modified: trunk/libscope-upper-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libscope-upper-perl/Changes?rev=35804&op=diff
==============================================================================
--- trunk/libscope-upper-perl/Changes (original)
+++ trunk/libscope-upper-perl/Changes Tue May 19 05:12:14 2009
@@ -1,4 +1,11 @@
 Revision history for Scope-Upper
+
+0.09    2009-05-17 20:20 UTC
+        + Add : The new SU_THREADSAFE constant can be used to know whether the
+                module could have been built with thread safety enabled.
+        + Chg : Thread safety is disabled for perl 5.8 on Win32.
+        + Chg : A saner workaround for the "call_sv() during LEAVE clobbers the
+                still used last popped stack element" issue on 5.10.
 
 0.08    2009-04-16 22:50 UTC
         + Fix : [RT #44204] : Stack corruption with reap(). Thanks Torsten

Modified: trunk/libscope-upper-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libscope-upper-perl/MANIFEST?rev=35804&op=diff
==============================================================================
--- trunk/libscope-upper-perl/MANIFEST (original)
+++ trunk/libscope-upper-perl/MANIFEST Tue May 19 05:12:14 2009
@@ -1,5 +1,6 @@
 Changes
 MANIFEST
+META.yml
 Makefile.PL
 README
 Upper.xs
@@ -33,10 +34,8 @@
 t/59-unwind-threads.t
 t/81-stress-level.t
 t/85-stress-unwind.t
-t/90-boilerplate.t
 t/91-pod.t
 t/92-pod-coverage.t
 t/95-portability-files.t
 t/99-kwalitee.t
 t/lib/Scope/Upper/TestGenerator.pm
-META.yml                                 Module meta-data (added by MakeMaker)

Modified: trunk/libscope-upper-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libscope-upper-perl/META.yml?rev=35804&op=diff
==============================================================================
--- trunk/libscope-upper-perl/META.yml (original)
+++ trunk/libscope-upper-perl/META.yml Tue May 19 05:12:14 2009
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               Scope-Upper
-version:            0.08
+version:            0.09
 abstract:           Act on upper scopes.
 author:
     - Vincent Pit <perl at profvince.com>
@@ -19,7 +19,7 @@
     bugtracker:  http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Scope-Upper
     homepage:    http://search.cpan.org/dist/Scope-Upper/
     license:     http://dev.perl.org/licenses/
-    repository:  http://git.profvince.com/?p=perl/modules/Scope-Upper.git
+    repository:  http://git.profvince.com/?p=perl%2Fmodules%2FScope-Upper.git
 no_index:
     directory:
         - t

Modified: trunk/libscope-upper-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libscope-upper-perl/Makefile.PL?rev=35804&op=diff
==============================================================================
--- trunk/libscope-upper-perl/Makefile.PL (original)
+++ trunk/libscope-upper-perl/Makefile.PL Tue May 19 05:12:14 2009
@@ -1,6 +1,17 @@
+use 5.006;
+
 use strict;
 use warnings;
 use ExtUtils::MakeMaker;
+
+my @DEFINES;
+
+# Threads, Windows and 5.8.x don't seem to be best friends
+if ($^O eq 'MSWin32' && $^V lt v5.9.0) {
+ push @DEFINES, '-DSU_MULTIPLICITY=0';
+}
+
+ at DEFINES = (DEFINE => join ' ', @DEFINES) if @DEFINES;
 
 my $dist = 'Scope-Upper';
 
@@ -16,7 +27,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",
  },
 );
 
@@ -27,6 +38,7 @@
     VERSION_FROM     => 'lib/Scope/Upper.pm',
     ABSTRACT_FROM    => 'lib/Scope/Upper.pm',
     PL_FILES         => {},
+    @DEFINES,
     PREREQ_PM        => {
         'Exporter' => 0,
         'XSLoader' => 0,

Modified: trunk/libscope-upper-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libscope-upper-perl/README?rev=35804&op=diff
==============================================================================
--- trunk/libscope-upper-perl/README (original)
+++ trunk/libscope-upper-perl/README Tue May 19 05:12:14 2009
@@ -2,7 +2,7 @@
     Scope::Upper - Act on upper scopes.
 
 VERSION
-    Version 0.08
+    Version 0.09
 
 SYNOPSIS
         package X;
@@ -171,6 +171,10 @@
         }->();
 
     will righteously set $num to 26.
+
+CONSTANTS
+  "SU_THREADSAFE"
+    True iff the module could have been built when thread-safety features.
 
 WORDS
   Constants
@@ -272,6 +276,9 @@
     "unwind" and "want_at" are only exported on request, either individually
     or by the tags ':funcs' and ':all'.
 
+    The constant "SU_THREADSAFE" is also only exported on request,
+    individually or by the tags ':consts' and ':all'.
+
     Same goes for the words "TOP", "HERE", "UP", "SUB", "EVAL", "SCOPE" and
     "CALLER" that are only exported on request, individually or by the tags
     ':words' and ':all'.

Modified: trunk/libscope-upper-perl/Upper.xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libscope-upper-perl/Upper.xs?rev=35804&op=diff
==============================================================================
--- trunk/libscope-upper-perl/Upper.xs (original)
+++ trunk/libscope-upper-perl/Upper.xs Tue May 19 05:12:14 2009
@@ -277,8 +277,10 @@
 
 STATIC void su_call(pTHX_ void *ud_) {
  su_ud_reap *ud = (su_ud_reap *) ud_;
-#if SU_HAS_PERL(5, 10, 0)
+#if SU_HAS_PERL(5, 9, 5)
+ PERL_CONTEXT saved_cx;
  I32 dieing = PL_op->op_type == OP_DIE;
+ I32 cxix;
 #endif
 
  dSP;
@@ -291,23 +293,24 @@
  PUSHMARK(SP);
  PUTBACK;
 
- /* If cxstack_ix isn't incremented there, the eval context will be overwritten
-  * when the new sub scope will be created in call_sv. */
-
-#if SU_HAS_PERL(5, 10, 0)
+ /* If the recently popped context isn't saved there, it will be overwritten by
+  * the sub scope from call_sv, although it's still needed in our caller. */
+
+#if SU_HAS_PERL(5, 9, 5)
  if (dieing) {
   if (cxstack_ix < cxstack_max)
-   ++cxstack_ix;
+   cxix = cxstack_ix + 1;
   else
-   cxstack_ix = Perl_cxinc(aTHX);
+   cxix = Perl_cxinc(aTHX);
+  saved_cx = cxstack[cxix];
  }
 #endif
 
  call_sv(ud->cb, G_VOID);
 
-#if SU_HAS_PERL(5, 10, 0)
- if (dieing && cxstack_ix > 0)
-  --cxstack_ix;
+#if SU_HAS_PERL(5, 9, 5)
+ if (dieing)
+  cxstack[cxix] = saved_cx;
 #endif
 
  PUTBACK;
@@ -717,7 +720,8 @@
  HV *stash;
  MY_CXT_INIT;
  stash = gv_stashpv(__PACKAGE__, 1);
- newCONSTSUB(stash, "TOP", newSViv(0));
+ newCONSTSUB(stash, "TOP",           newSViv(0));
+ newCONSTSUB(stash, "SU_THREADSAFE", newSVuv(SU_THREADSAFE));
  newXSproto("Scope::Upper::unwind", XS_Scope__Upper_unwind, file, NULL);
 }
 

Modified: trunk/libscope-upper-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libscope-upper-perl/debian/changelog?rev=35804&op=diff
==============================================================================
--- trunk/libscope-upper-perl/debian/changelog (original)
+++ trunk/libscope-upper-perl/debian/changelog Tue May 19 05:12:14 2009
@@ -1,3 +1,17 @@
+libscope-upper-perl (0.09-1) UNRELEASED; urgency=low
+
+  * New upstream release (NO RELEASE NECESSARY)
+  * Win32 compatibility fixes (with threading)
+  * New constant exported to see whether threading is available; it is
+    on Debian, but not Win32 with Perls older than 5.8.
+  * Added some tests
+  * Very very minor (actually pretty much irrelevant) formatting changes
+    to debian/control
+  * Added /me to Uploaders, but this might not even be necessary as this
+    version is not being released
+
+ -- Jonathan Yu <frequency at cpan.org>  Tue, 19 May 2009 01:02:31 -0400
+
 libscope-upper-perl (0.08-1) unstable; urgency=low
 
   * Initial release (closes: #524706).

Modified: trunk/libscope-upper-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libscope-upper-perl/debian/control?rev=35804&op=diff
==============================================================================
--- trunk/libscope-upper-perl/debian/control (original)
+++ trunk/libscope-upper-perl/debian/control Tue May 19 05:12:14 2009
@@ -4,7 +4,8 @@
 Build-Depends: debhelper (>= 7), perl (>= 5.6.0-12),
  libtest-pod-perl, libtest-pod-coverage-perl
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
-Uploaders: gregor herrmann <gregoa at debian.org>
+Uploaders: gregor herrmann <gregoa at debian.org>,
+ Jonathan Yu <frequency at cpan.org>
 Standards-Version: 3.8.1
 Homepage: http://search.cpan.org/dist/Scope-Upper/
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libscope-upper-perl/
@@ -13,13 +14,15 @@
 Package: libscope-upper-perl
 Architecture: any
 Depends: ${misc:Depends}, ${perl:Depends}, ${shlibs:Depends}
-Description: Perl module to act on upper scopes
+Description: Perl module to manipulate upper scopes
  Scope::Upper lets you defer actions at run-time that will take place when the
- control flow returns into an upper scope. Currently, you can:
+ control flow returns into an upper scope.
  .
-  * hook an upper scope end with "reap";
-  * localize variables, array/hash values or deletions of elements in
+ Currently, developers can:
+ .
+  * Hook an upper scope end with "reap";
+  * Localize variables, array/hash values or deletions of elements in
     higher contexts with respectively "localize", "localize_elem" and
     "localize_delete";
-  * return values immediately to an upper level with "unwind", and know
+  * Return values immediately to an upper level with "unwind", and know
     which context was in use then with "want_at".

Modified: trunk/libscope-upper-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libscope-upper-perl/debian/copyright?rev=35804&op=diff
==============================================================================
--- trunk/libscope-upper-perl/debian/copyright (original)
+++ trunk/libscope-upper-perl/debian/copyright Tue May 19 05:12:14 2009
@@ -10,7 +10,8 @@
 License: Artistic | GPL-1+
 
 Files: debian/*
-Copyright: 2009, gregor herrmann <gregoa at debian.org>
+Copyright: 2009, Jonathan Yu <frequency at cpan.org>
+ 2009, gregor herrmann <gregoa at debian.org>
 License: Artistic | GPL-1+
 
 License: Artistic

Modified: trunk/libscope-upper-perl/lib/Scope/Upper.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libscope-upper-perl/lib/Scope/Upper.pm?rev=35804&op=diff
==============================================================================
--- trunk/libscope-upper-perl/lib/Scope/Upper.pm (original)
+++ trunk/libscope-upper-perl/lib/Scope/Upper.pm Tue May 19 05:12:14 2009
@@ -9,13 +9,13 @@
 
 =head1 VERSION
 
-Version 0.08
+Version 0.09
 
 =cut
 
 our $VERSION;
 BEGIN {
- $VERSION = '0.08';
+ $VERSION = '0.09';
 }
 
 =head1 SYNOPSIS
@@ -210,6 +210,12 @@
     }->();
 
 will righteously set C<$num> to C<26>.
+
+=head1 CONSTANTS
+
+=head2 C<SU_THREADSAFE>
+
+True iff the module could have been built when thread-safety features.
 
 =head1 WORDS
 
@@ -318,6 +324,8 @@
 
 The functions L</reap>, L</localize>, L</localize_elem>, L</localize_delete>,  L</unwind> and L</want_at> are only exported on request, either individually or by the tags C<':funcs'> and C<':all'>.
 
+The constant L</SU_THREADSAFE> is also only exported on request, individually or by the tags C<':consts'> and C<':all'>.
+
 Same goes for the words L</TOP>, L</HERE>, L</UP>, L</SUB>, L</EVAL>, L</SCOPE> and L</CALLER> that are only exported on request, individually or by the tags C<':words'> and C<':all'>.
 
 =cut
@@ -326,8 +334,9 @@
 
 our @EXPORT      = ();
 our %EXPORT_TAGS = (
- funcs => [ qw/reap localize localize_elem localize_delete unwind want_at/ ],
- words => [ qw/TOP HERE UP SUB EVAL SCOPE CALLER/ ],
+ funcs  => [ qw/reap localize localize_elem localize_delete unwind want_at/ ],
+ words  => [ qw/TOP HERE UP SUB EVAL SCOPE CALLER/ ],
+ consts => [ qw/SU_THREADSAFE/ ],
 );
 our @EXPORT_OK   = map { @$_ } values %EXPORT_TAGS;
 $EXPORT_TAGS{'all'} = [ @EXPORT_OK ];

Modified: trunk/libscope-upper-perl/t/01-import.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libscope-upper-perl/t/01-import.t?rev=35804&op=diff
==============================================================================
--- trunk/libscope-upper-perl/t/01-import.t (original)
+++ trunk/libscope-upper-perl/t/01-import.t Tue May 19 05:12:14 2009
@@ -3,11 +3,29 @@
 use strict;
 use warnings;
 
-use Test::More tests => 13;
+use Test::More tests => 2 * 14;
 
 require Scope::Upper;
 
-for (qw/reap localize localize_elem localize_delete unwind want_at TOP HERE UP SUB EVAL SCOPE CALLER/) {
+my %syms = (
+ reap            => '&;$',
+ localize        => '$$;$',
+ localize_elem   => '$$$;$',
+ localize_delete => '$$;$',
+ unwind          => undef,
+ want_at         => ';$',
+ TOP             => '',
+ HERE            => '',
+ UP              => ';$',
+ SUB             => ';$',
+ EVAL            => ';$',
+ SCOPE           => ';$',
+ CALLER          => ';$',
+ SU_THREADSAFE   => '',
+);
+
+for (keys %syms) {
  eval { Scope::Upper->import($_) };
- is($@, '', 'import ' . $_);
+ is $@,            '',        "import $_";
+ is prototype($_), $syms{$_}, "prototype $_";
 }

Modified: trunk/libscope-upper-perl/t/59-unwind-threads.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libscope-upper-perl/t/59-unwind-threads.t?rev=35804&op=diff
==============================================================================
--- trunk/libscope-upper-perl/t/59-unwind-threads.t (original)
+++ trunk/libscope-upper-perl/t/59-unwind-threads.t Tue May 19 05:12:14 2009
@@ -17,14 +17,16 @@
  skipall 'threads required to test thread safety' unless eval "use threads; 1";
 }
 
+use Test::More;
+
+use Scope::Upper qw/unwind UP SU_THREADSAFE/;
+
 my $num;
-BEGIN { $num = 20; }
-
-use Test::More tests => $num;
 
 BEGIN {
+ skipall 'This Scope::Upper isn\'t thread safe' unless SU_THREADSAFE;
+ plan tests => ($num = 30);
  defined and diag "Using threads $_" for $threads::VERSION;
-
  if (eval "use Time::HiRes; 1") {
   defined and diag "Using Time::HiRes $_" for $Time::HiRes::VERSION;
   *usleep = \&Time::HiRes::usleep;
@@ -37,12 +39,7 @@
  }
 }
 
-use Scope::Upper qw/unwind UP/;
-
 our $z;
-
-BEGIN {
-}
 
 sub up1 {
  my $tid  = threads->tid();




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