r51567 - in /trunk/libcapture-tiny-perl: Changes MANIFEST.SKIP META.yml Makefile.PL README debian/changelog debian/control debian/copyright lib/Capture/Tiny.pm lib/Capture/Tiny.pod t/01-Capture-Tiny.t t/09-preserve-exit-code.t t/lib/Cases.pm

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Mon Jan 25 17:46:35 UTC 2010


Author: jawnsy-guest
Date: Mon Jan 25 17:46:27 2010
New Revision: 51567

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=51567
Log:
* New upstream release
* Rewrite control description
* Update copyright to new DEP5 format

Modified:
    trunk/libcapture-tiny-perl/Changes
    trunk/libcapture-tiny-perl/MANIFEST.SKIP
    trunk/libcapture-tiny-perl/META.yml
    trunk/libcapture-tiny-perl/Makefile.PL
    trunk/libcapture-tiny-perl/README
    trunk/libcapture-tiny-perl/debian/changelog
    trunk/libcapture-tiny-perl/debian/control
    trunk/libcapture-tiny-perl/debian/copyright
    trunk/libcapture-tiny-perl/lib/Capture/Tiny.pm
    trunk/libcapture-tiny-perl/lib/Capture/Tiny.pod
    trunk/libcapture-tiny-perl/t/01-Capture-Tiny.t
    trunk/libcapture-tiny-perl/t/09-preserve-exit-code.t
    trunk/libcapture-tiny-perl/t/lib/Cases.pm

Modified: trunk/libcapture-tiny-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcapture-tiny-perl/Changes?rev=51567&op=diff
==============================================================================
--- trunk/libcapture-tiny-perl/Changes (original)
+++ trunk/libcapture-tiny-perl/Changes Mon Jan 25 17:46:27 2010
@@ -2,10 +2,19 @@
 # Copyright (c) 2009 by David Golden. All rights reserved.
 # Licensed under Apache License, Version 2.0 (the "License").
 # You may not use this file except in compliance with the License.
-# A copy of the License was distributed with this file or you may obtain a 
+# A copy of the License was distributed with this file or you may obtain a
 # copy of the License from http://www.apache.org/licenses/LICENSE-2.0
 
 Revision history for Capture-Tiny
+
+0.07 Sun Jan 24 00:18:45 EST 2010
+
+  Fixed:
+
+  - Changed test for $? preservation to be more portable
+
+  - Dropped support for Perl 5.8.0 specifically due to excessive bugs.
+    Tests will bail out. (5.6.X is still supported)
 
 0.06 Thu May  7 06:54:53 EDT 2009
 
@@ -56,12 +65,12 @@
   Fixed:
 
     - Tests skip if not Win32 and no fork() (rather than Build.PL and
-      Makefile.PL failing); this allows capture() on odd platforms, even if 
+      Makefile.PL failing); this allows capture() on odd platforms, even if
       fork doesn't work
 
 0.02 Tue Feb 17 17:24:35 EST 2009
 
-  Fixed: 
+  Fixed:
 
     - Bug recovering output when STDOUT is empty (reported by Vincent Pit)
 

Modified: trunk/libcapture-tiny-perl/MANIFEST.SKIP
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcapture-tiny-perl/MANIFEST.SKIP?rev=51567&op=diff
==============================================================================
--- trunk/libcapture-tiny-perl/MANIFEST.SKIP (original)
+++ trunk/libcapture-tiny-perl/MANIFEST.SKIP Mon Jan 25 17:46:27 2010
@@ -22,6 +22,7 @@
 ^_build
 ^cover_db
 ^.*\.bat$
+^MYMETA\.
 
 # Temp, old, vi and emacs files.
 ~$

Modified: trunk/libcapture-tiny-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcapture-tiny-perl/META.yml?rev=51567&op=diff
==============================================================================
--- trunk/libcapture-tiny-perl/META.yml (original)
+++ trunk/libcapture-tiny-perl/META.yml Mon Jan 25 17:46:27 2010
@@ -1,31 +1,33 @@
 ---
-name: Capture-Tiny
-version: 0.06
+abstract: 'Capture STDOUT and STDERR from Perl, XS or external programs'
 author:
   - 'David Golden <dagolden at cpan.org>'
-abstract: 'Capture STDOUT and STDERR from Perl, XS or external programs'
+build_requires:
+  Test::More: 0.62
+configure_requires:
+  Module::Build: 0.36
+generated_by: 'Module::Build version 0.3603'
 license: apache
-resources:
-  bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=Capture-Tiny
-  repository: http://github.com/dagolden/capture-tiny/
+meta-spec:
+  url: http://module-build.sourceforge.net/META-spec-v1.4.html
+  version: 1.4
+name: Capture-Tiny
+no_index:
+  directory:
+    - examples
+    - inc
+    - t
+provides:
+  Capture::Tiny:
+    file: lib/Capture/Tiny.pm
+    version: 0.07
 requires:
   Exporter: 0
   File::Spec: 0
   File::Temp: 0.14
   IO::Handle: 0
   perl: 5.006
-build_requires:
-  Test::More: 0.62
-provides:
-  Capture::Tiny:
-    file: lib/Capture/Tiny.pm
-    version: 0.06
-generated_by: Module::Build version 0.3201
-meta-spec:
-  url: http://module-build.sourceforge.net/META-spec-v1.4.html
-  version: 1.4
-no_index:
-  directory:
-    - examples
-    - inc
-    - t
+resources:
+  bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=Capture-Tiny
+  repository: http://github.com/dagolden/capture-tiny/
+version: 0.07

Modified: trunk/libcapture-tiny-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcapture-tiny-perl/Makefile.PL?rev=51567&op=diff
==============================================================================
--- trunk/libcapture-tiny-perl/Makefile.PL (original)
+++ trunk/libcapture-tiny-perl/Makefile.PL Mon Jan 25 17:46:27 2010
@@ -1,19 +1,19 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.32_01
+# Note: this file was auto-generated by Module::Build::Compat version 0.3603
 require 5.006;
 use ExtUtils::MakeMaker;
 WriteMakefile
 (
-          'PL_FILES' => {},
-          'INSTALLDIRS' => 'site',
           'NAME' => 'Capture::Tiny',
-          'EXE_FILES' => [],
           'VERSION_FROM' => 'lib/Capture/Tiny.pm',
           'PREREQ_PM' => {
-                           'Test::More' => '0.62',
+                           'Exporter' => 0,
+                           'File::Spec' => 0,
+                           'File::Temp' => '0.14',
                            'IO::Handle' => 0,
-                           'File::Temp' => '0.14',
-                           'File::Spec' => 0,
-                           'Exporter' => 0
-                         }
+                           'Test::More' => '0.62'
+                         },
+          'INSTALLDIRS' => 'site',
+          'EXE_FILES' => [],
+          'PL_FILES' => {}
         )
 ;

Modified: trunk/libcapture-tiny-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcapture-tiny-perl/README?rev=51567&op=diff
==============================================================================
--- trunk/libcapture-tiny-perl/README (original)
+++ trunk/libcapture-tiny-perl/README Mon Jan 25 17:46:27 2010
@@ -3,24 +3,24 @@
     programs
 
 VERSION
-    This documentation describes version 0.06.
+    This documentation describes version 0.07.
 
 SYNOPSIS
          use Capture::Tiny qw/capture tee capture_merged tee_merged/;
-     
-     ($stdout, $stderr) = capture {
-           # your code here
-         };
-     
-     ($stdout, $stderr) = tee {
-           # your code here
-         };
-     
-     $merged = capture_merged {
-           # your code here
-         };
-     
-     $merged = tee_merged {
+ 
+         ($stdout, $stderr) = capture {
+           # your code here
+         };
+ 
+         ($stdout, $stderr) = tee {
+           # your code here
+         };
+ 
+         $merged = capture_merged {
+           # your code here
+         };
+ 
+         $merged = tee_merged {
            # your code here
          };
 
@@ -43,7 +43,7 @@
        ($stdout, $stderr) = capture \&code;
        $stdout = capture \&code;
 
-    The "capture" function takes a code reference and returns what is sent
+    The `capture' function takes a code reference and returns what is sent
     to STDOUT and STDERR. In scalar context, it returns only STDOUT. If no
     output was received, returns an empty string. Regardless of context, all
     output is captured -- nothing is passed to the existing handles.
@@ -58,10 +58,10 @@
   capture_merged
        $merged = capture_merged \&code;
 
-    The "capture_merged" function works just like "capture" except STDOUT
+    The `capture_merged' function works just like `capture' except STDOUT
     and STDERR are merged. (Technically, STDERR is redirected to STDOUT
     before executing the function.) If no output was received, returns an
-    empty string. As with "capture" it may be called in block form.
+    empty string. As with `capture' it may be called in block form.
 
     Caution: STDOUT and STDERR output in the merged result are not
     guaranteed to be properly ordered due to buffering.
@@ -70,15 +70,15 @@
        ($stdout, $stderr) = tee \&code;
        $stdout = tee \&code;
 
-    The "tee" function works just like "capture", except that output is
+    The `tee' function works just like `capture', except that output is
     captured as well as passed on to the original STDOUT and STDERR. As with
-    "capture" it may be called in block form.
+    `capture' it may be called in block form.
 
   tee_merged
        $merged = tee_merged \&code;
 
-    The "tee_merged" function works just like "capture_merged" except that
-    output is captured as well as passed on to STDOUT. As with "capture" it
+    The `tee_merged' function works just like `capture_merged' except that
+    output is captured as well as passed on to STDOUT. As with `capture' it
     may be called in block form.
 
     Caution: STDOUT and STDERR output in the merged result are not
@@ -86,14 +86,14 @@
 
 LIMITATIONS
   Portability
-    Portability is a goal, not a guarantee. "tee" requires fork, except on
-    Windows where "system(1, @cmd)" is used instead. Not tested on any
+    Portability is a goal, not a guarantee. `tee' requires fork, except on
+    Windows where `system(1, @cmd)' is used instead. Not tested on any
     particularly esoteric platforms yet.
 
   PerlIO layers
     Capture::Tiny does it's best to preserve PerlIO layers such as ':utf8'
     or ':crlf' when capturing. Layers should be applied to STDOUT or STDERR
-    *before* the call to "capture" or "tee".
+    *before* the call to `capture' or `tee'.
 
   Closed STDIN, STDOUT or STDERR
     Capture::Tiny will work even if STDIN, STDOUT or STDERR have been
@@ -105,8 +105,8 @@
 
   Scalar filehandles and STDIN, STDOUT or STDERR
     If STDOUT or STDERR are reopened to scalar filehandles prior to the call
-    to "capture" or "tee", then Capture::Tiny will override the output
-    handle for the duration of the "capture" or "tee" call and then send
+    to `capture' or `tee', then Capture::Tiny will override the output
+    handle for the duration of the `capture' or `tee' call and then send
     captured output to the output handle after the capture is complete.
     (Requires Perl 5.8)
 
@@ -114,9 +114,9 @@
     scalar reference.
 
   Tied STDIN, STDOUT or STDERR
-    If STDOUT or STDERR are tied prior to the call to "capture" or "tee",
+    If STDOUT or STDERR are tied prior to the call to `capture' or `tee',
     then Capture::Tiny will attempt to override the tie for the duration of
-    the "capture" or "tee" call and then send captured output to the tied
+    the `capture' or `tee' call and then send captured output to the tied
     handle after the capture is complete. (Requires Perl 5.8)
 
     Capture::Tiny does not (yet) support resending utf8 encoded data to a
@@ -126,13 +126,16 @@
     capturing or teeing when STDIN is tied is currently broken on Windows.
 
   Modifiying STDIN, STDOUT or STDERR during a capture
-    Attempting to modify STDIN, STDOUT or STDERR *during* "capture" or "tee"
+    Attempting to modify STDIN, STDOUT or STDERR *during* `capture' or `tee'
     is almost certainly going to cause problems. Don't do that.
+
+  No support for Perl 5.8.0
+    It's just too buggy when it comes to layers and UTF8.
 
 BUGS
     Please report any bugs or feature requests using the CPAN Request
     Tracker. Bugs can be submitted through the web interface at
-    <http://rt.cpan.org/Dist/Display.html?Queue=Capture-Tiny>
+    http://rt.cpan.org/Dist/Display.html?Queue=Capture-Tiny
 
     When submitting a bug or request, please include a test-file or a patch
     to an existing test-file that illustrates the bug or desired feature.
@@ -194,7 +197,8 @@
     Licensed under Apache License, Version 2.0 (the "License"). You may not
     use this file except in compliance with the License. A copy of the
     License was distributed with this file or you may obtain a copy of the
-    License from http://www.apache.org/licenses/LICENSE-2.0
+    License from
+    http:E<sol>E<sol>www.apache.orgE<sol>licensesE<sol>LICENSE-2.0
 
     Files produced as output though the use of this software, shall not be
     considered Derivative Works, but shall be considered the original work

Modified: trunk/libcapture-tiny-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcapture-tiny-perl/debian/changelog?rev=51567&op=diff
==============================================================================
--- trunk/libcapture-tiny-perl/debian/changelog (original)
+++ trunk/libcapture-tiny-perl/debian/changelog Mon Jan 25 17:46:27 2010
@@ -1,4 +1,9 @@
-libcapture-tiny-perl (0.06-2) UNRELEASED; urgency=low
+libcapture-tiny-perl (0.07-1) UNRELEASED; urgency=low
+
+  [ Jonathan Yu ]
+  * New upstream release
+  * Rewrite control description
+  * Update copyright to new DEP5 format
 
   [ Nathan Handler ]
   * debian/watch: Update to ignore development releases.
@@ -11,7 +16,7 @@
   [ Ryan Niebur ]
   * Update ryan52's email address
 
- -- Ryan Niebur <ryan at debian.org>  Fri, 25 Sep 2009 00:24:03 -0700
+ -- Jonathan Yu <jawnsy at cpan.org>  Mon, 25 Jan 2010 12:28:33 -0500
 
 libcapture-tiny-perl (0.06-1) unstable; urgency=low
 

Modified: trunk/libcapture-tiny-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcapture-tiny-perl/debian/control?rev=51567&op=diff
==============================================================================
--- trunk/libcapture-tiny-perl/debian/control (original)
+++ trunk/libcapture-tiny-perl/debian/control Mon Jan 25 17:46:27 2010
@@ -4,8 +4,8 @@
 Build-Depends: debhelper (>= 7)
 Build-Depends-Indep: perl
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
-Uploaders: Ryan Niebur <ryan at debian.org>
-Standards-Version: 3.8.1
+Uploaders: Ryan Niebur <ryan at debian.org>, Jonathan Yu <jawnsy at cpan.org>
+Standards-Version: 3.8.3
 Homepage: http://search.cpan.org/dist/Capture-Tiny/
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libcapture-tiny-perl/
 Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libcapture-tiny-perl/
@@ -13,9 +13,8 @@
 Package: libcapture-tiny-perl
 Architecture: all
 Depends: ${perl:Depends}, ${misc:Depends}
-Description: Perl module to capture STDOUT and STDERR from Perl, XS or external programs
- Capture::Tiny provides a simple, portable way to capture anything
- sent to STDOUT or STDERR, regardless of whether it comes from Perl,
- from XS code or from an external program. Optionally, output can be
- teed so that it is captured while being passed through to the
- original handles.
+Description: module to capture STDOUT and STDERR
+ Capture::Tiny is a Perl module that provides a simple, portable way to
+ capture anything sent to STDOUT or STDERR, regardless of whether it comes
+ from Perl, XS code or an external program. Further, output can be captured
+ while being passed through to the original handles.

Modified: trunk/libcapture-tiny-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcapture-tiny-perl/debian/copyright?rev=51567&op=diff
==============================================================================
--- trunk/libcapture-tiny-perl/debian/copyright (original)
+++ trunk/libcapture-tiny-perl/debian/copyright Mon Jan 25 17:46:27 2010
@@ -1,46 +1,49 @@
-Format-Specification:
-    http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=196
-Upstream-Maintainer: David Golden <dagolden at cpan.org>
-Upstream-Source: http://search.cpan.org/dist/Capture-Tiny/
-Upstream-Name: Capture-Tiny
+Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=59
+Maintainer: David Golden <dagolden at cpan.org>
+Source: http://search.cpan.org/dist/Capture-Tiny/
+Name: Capture-Tiny
 
 Files: *
-Copyright: Copyright (c) 2009 by David A. Golden. All rights reserved.
+Copyright: 2009, David A. Golden <dagolden at cpan.org>
 License: Apache-2.0
 
 Files: debian/*
-Copyright: 2009, Ryan Niebur <ryan at debian.org>
-License: Apache-2.0 | Artistic | GPL-1+
+Copyright: 2010, Jonathan Yu <jawnsy at cpan.org>
+ 2009, Ryan Niebur <ryan at debian.org>
+License: Apache-2.0 or Artistic or GPL-1+
 
 License: Apache-2.0
-    Licensed under Apache License, Version 2.0 (the "License"). You may not
-    use this file except in compliance with the License. A copy of the
-    License was distributed with this file or you may obtain a copy of the
-    License from http://www.apache.org/licenses/LICENSE-2.0
-    .
-    Files produced as output though the use of this software, shall not be
-    considered Derivative Works, but shall be considered the original work
-    of the Licensor.
-    .
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
-    .
-    On Debian GNU/Linux systems, the complete text of the Apache License,
-    Version 2.0 can be found in `/usr/share/common-licenses/Apache-2.0'
+ Licensed under Apache License, Version 2.0 (the "License"). You may not
+ use this file except in compliance with the License. A copy of the
+ License was distributed with this file or you may obtain a copy of the
+ License from http://www.apache.org/licenses/LICENSE-2.0
+ .
+ Files produced as output though the use of this software, shall not be
+ considered Derivative Works, but shall be considered the original work
+ of the Licensor.
+ .
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ .
+ On Debian GNU/Linux systems, the complete text of the Apache License,
+ Version 2.0 can be found in `/usr/share/common-licenses/Apache-2.0'
 
 License: Artistic
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Artistic License, which comes with Perl.
-    On Debian GNU/Linux systems, the complete text of the Artistic License
-    can be found in `/usr/share/common-licenses/Artistic'
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the Artistic License, which comes with Perl.
+ .
+ On Debian GNU/Linux systems, the complete text of the Artistic License
+ can be found in `/usr/share/common-licenses/Artistic'
 
 License: GPL-1+
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 1, or (at your option)
-    any later version.
-    On Debian GNU/Linux systems, the complete text of the GNU General
-    Public License can be found in `/usr/share/common-licenses/GPL'
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 1, or (at your option)
+ any later version.
+ .
+ On Debian GNU/Linux systems, the complete text of the GNU General
+ Public License can be found in `/usr/share/common-licenses/GPL'
+

Modified: trunk/libcapture-tiny-perl/lib/Capture/Tiny.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcapture-tiny-perl/lib/Capture/Tiny.pm?rev=51567&op=diff
==============================================================================
--- trunk/libcapture-tiny-perl/lib/Capture/Tiny.pm (original)
+++ trunk/libcapture-tiny-perl/lib/Capture/Tiny.pm Mon Jan 25 17:46:27 2010
@@ -1,7 +1,7 @@
 # Copyright (c) 2009 by David Golden. All rights reserved.
 # Licensed under Apache License, Version 2.0 (the "License").
 # You may not use this file except in compliance with the License.
-# A copy of the License was distributed with this file or you may obtain a 
+# A copy of the License was distributed with this file or you may obtain a
 # copy of the License from http://www.apache.org/licenses/LICENSE-2.0
 
 package Capture::Tiny;
@@ -14,9 +14,12 @@
 use File::Spec ();
 use File::Temp qw/tempfile tmpnam/;
 # Get PerlIO or fake it
-BEGIN { eval { require PerlIO; 1 } or *PerlIO::get_layers = sub { return () }; }
-
-our $VERSION = '0.06';
+BEGIN {
+  eval { require PerlIO; PerlIO->can('get_layers') }
+    or *PerlIO::get_layers = sub { return () };
+}
+
+our $VERSION = '0.07';
 $VERSION = eval $VERSION; ## no critic
 our @ISA = qw/Exporter/;
 our @EXPORT_OK = qw/capture capture_merged tee tee_merged/;
@@ -36,10 +39,10 @@
 # This is annoying, but seems to be the best that can be done
 # as a simple, portable IPC technique
 #--------------------------------------------------------------------------#
-my @cmd = ($^X, '-e', '$SIG{HUP}=sub{exit}; ' 
+my @cmd = ($^X, '-e', '$SIG{HUP}=sub{exit}; '
   . 'if( my $fn=shift ){ open my $fh, qq{>$fn}; print {$fh} $$; close $fh;} '
   . 'my $buf; while (sysread(STDIN, $buf, 2048)) { '
-  . 'syswrite(STDOUT, $buf); syswrite(STDERR, $buf)}' 
+  . 'syswrite(STDOUT, $buf); syswrite(STDERR, $buf)}'
 );
 
 #--------------------------------------------------------------------------#
@@ -72,7 +75,7 @@
 }
 
 my %dup; # cache this so STDIN stays fd0
-my %proxy_count;  
+my %proxy_count;
 sub _proxy_std {
   my %proxies;
   if ( ! defined fileno STDIN ) {
@@ -122,13 +125,13 @@
 
 sub _unproxy {
   my (%proxies) = @_;
-  _debug( "# unproxing " . join(" ", keys %proxies) . "\n" ); 
+  _debug( "# unproxing " . join(" ", keys %proxies) . "\n" );
   for my $p ( keys %proxies ) {
     $proxy_count{$p}--;
     _debug( "# unproxied " . uc($p) . " ($proxy_count{$p} left)\n" );
     if ( ! $proxy_count{$p} ) {
       _close $proxies{$p};
-      _close $dup{$p} unless $] < 5.008; # 5.6 will have already closed this as dup 
+      _close $dup{$p} unless $] < 5.008; # 5.6 will have already closed this as dup
       delete $dup{$p};
     }
   }
@@ -136,8 +139,8 @@
 
 sub _copy_std {
   my %handles = map { $_, IO::Handle->new } qw/stdin stdout stderr/;
-  _debug( "# copying std handles ...\n" ); 
-  _open $handles{stdin},   "<&STDIN"; 
+  _debug( "# copying std handles ...\n" );
+  _open $handles{stdin},   "<&STDIN";
   _open $handles{stdout},  ">&STDOUT";
   _open $handles{stderr},  ">&STDERR";
   return \%handles;
@@ -159,8 +162,8 @@
   # setup pipes
   $stash->{$_}{$which} = IO::Handle->new for qw/tee reader/;
   pipe $stash->{reader}{$which}, $stash->{tee}{$which};
-  _debug( "# pipe for $which\: " .  _name($stash->{tee}{$which}) . " "  
-    . fileno( $stash->{tee}{$which} ) . " => " . _name($stash->{reader}{$which}) 
+  _debug( "# pipe for $which\: " .  _name($stash->{tee}{$which}) . " "
+    . fileno( $stash->{tee}{$which} ) . " => " . _name($stash->{reader}{$which})
     . " " . fileno( $stash->{reader}{$which}) . "\n" );
   select((select($stash->{tee}{$which}), $|=1)[0]); # autoflush
   # setup desired redirection for parent and child
@@ -195,17 +198,17 @@
 
 sub _fork_exec {
   my ($which, $stash) = @_;
-  my $pid = fork; 
+  my $pid = fork;
   if ( not defined $pid ) {
     Carp::confess "Couldn't fork(): $!";
   }
   elsif ($pid == 0) { # child
-    _debug( "# in child process ...\n" ); 
+    _debug( "# in child process ...\n" );
     untie *STDIN; untie *STDOUT; untie *STDERR;
     _close $stash->{tee}{$which};
-    _debug( "# redirecting handles in child ...\n" ); 
+    _debug( "# redirecting handles in child ...\n" );
     _open_std( $stash->{child}{$which} );
-    _debug( "# calling exec on command ...\n" ); 
+    _debug( "# calling exec on command ...\n" );
     exec @cmd, $stash->{flag_files}{$which};
   }
   $stash->{pid}{$which} = $pid
@@ -213,13 +216,13 @@
 
 sub _files_exist { -f $_ || return 0 for @_; return 1 }
 
-sub _wait_for_tees { 
+sub _wait_for_tees {
   my ($stash) = @_;
   my $start = time;
   my @files = values %{$stash->{flag_files}};
   1 until _files_exist(@files) || (time - $start > 30);
   Carp::confess "Timed out waiting for subprocesses to start" if ! _files_exist(@files);
-  unlink $_ for @files; 
+  unlink $_ for @files;
 }
 
 sub _kill_tees {
@@ -237,8 +240,8 @@
   }
 }
 
-sub _slurp { 
-  seek $_[0],0,0; local $/; return scalar readline $_[0]; 
+sub _slurp {
+  seek $_[0],0,0; local $/; return scalar readline $_[0];
 }
 
 #--------------------------------------------------------------------------#
@@ -246,7 +249,7 @@
 #--------------------------------------------------------------------------#
 
 sub _capture_tee {
-  _debug( "# starting _capture_tee with (@_)...\n" ); 
+  _debug( "# starting _capture_tee with (@_)...\n" );
   my ($tee_stdout, $tee_stderr, $merge, $code) = @_;
   # save existing filehandles and setup captures
   local *CT_ORIG_STDIN  = *STDIN ;
@@ -266,7 +269,7 @@
   $localize{stderr}++, local(*STDERR) if grep { $_ eq 'scalar' } @{$layers{stderr}};
   $localize{stdout}++, local(*STDOUT), _open( \*STDOUT, ">&=1") if tied *STDOUT && $] >= 5.008;
   $localize{stderr}++, local(*STDERR), _open( \*STDERR, ">&=2") if tied *STDERR && $] >= 5.008;
-  _debug( "# localized $_\n" ) for keys %localize; 
+  _debug( "# localized $_\n" ) for keys %localize;
   my %proxy_std = _proxy_std();
   _debug( "# proxy std is @{ [%proxy_std] }\n" );
   my $stash = { old => _copy_std() };
@@ -287,22 +290,22 @@
   # finalize redirection
   $stash->{new}{stderr} = $stash->{new}{stdout} if $merge;
   $stash->{new}{stdin} = $stash->{old}{stdin};
-  _debug( "# redirecting in parent ...\n" ); 
+  _debug( "# redirecting in parent ...\n" );
   _open_std( $stash->{new} );
   # execute user provided code
   my $exit_code;
   {
     local *STDIN = *CT_ORIG_STDIN if $localize{stdin}; # get original, not proxy STDIN
     local *STDERR = *STDOUT if $merge; # minimize buffer mixups during $code
-    _debug( "# finalizing layers ...\n" ); 
+    _debug( "# finalizing layers ...\n" );
     _relayer(\*STDOUT, $layers{stdout});
     _relayer(\*STDERR, $layers{stderr}) unless $merge;
-    _debug( "# running code $code ...\n" ); 
+    _debug( "# running code $code ...\n" );
     $code->();
     $exit_code = $?; # save this for later
   }
   # restore prior filehandles and shut down tees
-  _debug( "# restoring ...\n" ); 
+  _debug( "# restoring ...\n" );
   _open_std( $stash->{old} );
   _close( $_ ) for values %{$stash->{old}}; # don't leak fds
   _unproxy( %proxy_std );
@@ -313,16 +316,16 @@
   _debug( "# slurping captured $_ with layers: @{[PerlIO::get_layers($stash->{capture}{$_})]}\n") for qw/stdout stderr/;
   my $got_out = _slurp($stash->{capture}{stdout});
   my $got_err = $merge ? q() : _slurp($stash->{capture}{stderr});
-  print CT_ORIG_STDOUT $got_out if $localize{stdout} && $tee_stdout; 
-  print CT_ORIG_STDERR $got_err if !$merge && $localize{stderr} && $tee_stdout; 
+  print CT_ORIG_STDOUT $got_out if $localize{stdout} && $tee_stdout;
+  print CT_ORIG_STDERR $got_err if !$merge && $localize{stderr} && $tee_stdout;
   $? = $exit_code;
-  _debug( "# ending _capture_tee with (@_)...\n" ); 
+  _debug( "# ending _capture_tee with (@_)...\n" );
   return $got_out if $merge;
   return wantarray ? ($got_out, $got_err) : $got_out;
 }
 
 #--------------------------------------------------------------------------#
-# create API subroutines from [tee STDOUT flag, tee STDERR, merge flag]               
+# create API subroutines from [tee STDOUT flag, tee STDERR, merge flag]
 #--------------------------------------------------------------------------#
 
 my %api = (
@@ -333,7 +336,7 @@
 );
 
 for my $sub ( keys %api ) {
-  my $args = join q{, }, @{$api{$sub}}; 
+  my $args = join q{, }, @{$api{$sub}};
   eval "sub $sub(&) {unshift \@_, $args; goto \\&_capture_tee;}"; ## no critic
 }
 
@@ -486,6 +489,10 @@
 
 Attempting to modify STDIN, STDOUT or STDERR ~during~ {capture} or {tee} is
 almost certainly going to cause problems.  Don't do that.
+
+== No support for Perl 5.8.0
+
+It's just too buggy when it comes to layers and UTF8.
 
 = BUGS
 

Modified: trunk/libcapture-tiny-perl/lib/Capture/Tiny.pod
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcapture-tiny-perl/lib/Capture/Tiny.pod?rev=51567&op=diff
==============================================================================
--- trunk/libcapture-tiny-perl/lib/Capture/Tiny.pod (original)
+++ trunk/libcapture-tiny-perl/lib/Capture/Tiny.pod Mon Jan 25 17:46:27 2010
@@ -8,7 +8,7 @@
 
 =head1 VERSION
 
-This documentation describes version 0.06.
+This documentation describes version 0.07.
 
 =head1 SYNOPSIS
 
@@ -146,6 +146,10 @@
 Attempting to modify STDIN, STDOUT or STDERR I<during> C<<< capture >>> or C<<< tee >>> is
 almost certainly going to cause problems.  Don't do that.
 
+=head2 No support for Perl 5.8.0
+
+It's just too buggy when it comes to layers and UTF8.
+
 =head1 BUGS
 
 Please report any bugs or feature requests using the CPAN Request Tracker.

Modified: trunk/libcapture-tiny-perl/t/01-Capture-Tiny.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcapture-tiny-perl/t/01-Capture-Tiny.t?rev=51567&op=diff
==============================================================================
--- trunk/libcapture-tiny-perl/t/01-Capture-Tiny.t (original)
+++ trunk/libcapture-tiny-perl/t/01-Capture-Tiny.t Mon Jan 25 17:46:27 2010
@@ -18,6 +18,10 @@
 
 plan tests => 2 + 2 * @api;
 
+if ( $] eq '5.008' ) {
+  BAIL_OUT("OS unsupported: Perl 5.8.0 is too buggy for Capture::Tiny");
+}
+
 require_ok( 'Capture::Tiny' );
 
 can_ok('Capture::Tiny', $_) for @api;

Modified: trunk/libcapture-tiny-perl/t/09-preserve-exit-code.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcapture-tiny-perl/t/09-preserve-exit-code.t?rev=51567&op=diff
==============================================================================
--- trunk/libcapture-tiny-perl/t/09-preserve-exit-code.t (original)
+++ trunk/libcapture-tiny-perl/t/09-preserve-exit-code.t Mon Jan 25 17:46:27 2010
@@ -11,7 +11,7 @@
 use Capture::Tiny qw/capture/;
 use Config;
 
-plan tests => 4;
+plan tests => 2;
 
 my $builder = Test::More->builder;
 binmode($builder->failure_output, ':utf8') if $] >= 5.008;
@@ -19,20 +19,9 @@
 my $fd = next_fd;
 
 capture {
-  system($^X, '-e', 'exit 42');
+  $? = 42;
 };
-is( $? >> 8, 42, "exit code was 42" );
-
-SKIP: {
-  skip "alarm() not available", 1
-    unless $Config{d_alarm};
-
-  capture {
-    system($^X, '-e', 'alarm 1; $now = time; 1 while (time - $now < 5)');
-  };
-  ok( $?, '$? is non-zero' );
-  is( ($^O eq 'MSWin32' ? $? >> 8 : $? & 127), sig_num('ALRM'), "caught SIGALRM" );
-}
+is( $?, 42, "\$\? preserved after capture ends" );
 
 is( next_fd, $fd, "no file descriptors leaked" );
 

Modified: trunk/libcapture-tiny-perl/t/lib/Cases.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcapture-tiny-perl/t/lib/Cases.pm?rev=51567&op=diff
==============================================================================
--- trunk/libcapture-tiny-perl/t/lib/Cases.pm (original)
+++ trunk/libcapture-tiny-perl/t/lib/Cases.pm Mon Jan 25 17:46:27 2010
@@ -49,7 +49,7 @@
 my %texts = (
   short => 'Hello World',
   multiline => 'First line\nSecond line\n',
-  ( $] < 5.008 ? () : ( unicode => 'Hi! \x{263a}\n') ),
+  ( $] lt "5.008" ? () : ( unicode => 'Hi! \x{263a}\n') ),
 );
 
 #--------------------------------------------------------------------------#




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