[svn-upgrade] Integrating new upstream version, libipc-run-perl (0.84)
Gunnar Wolf
14 years ago
0 | 0 | Revision history for Perl extension IPC::Run |
1 | ||
2 | 0.84 Mon 13 Jul 2009 | |
3 | - Add darwin to the list of known-bad platforms | |
4 | ||
5 | 0.83 Fri 10 Jul 2009 | |
6 | - Switch from command.com to cmd.exe so we work on 2008 or newer. | |
1 | 7 | |
2 | 8 | 0.82 Thu 18 Dec 2008 |
3 | 9 | - Moving changes in 0.81_01 to a production release |
20 | 20 | Makefile.PL |
21 | 21 | MANIFEST This list of files |
22 | 22 | README |
23 | t/97_meta.t | |
24 | t/98_pod.t | |
25 | t/99_pmv.t | |
23 | 26 | t/adopt.t |
24 | 27 | t/binmode.t |
25 | 28 | t/bogus.t |
0 | 0 | --- #YAML:1.0 |
1 | 1 | name: IPC-Run |
2 | version: 0.82 | |
3 | abstract: ~ | |
2 | version: 0.84 | |
3 | abstract: system() and background procs w/ piping, redirs, ptys (Unix, Win32) | |
4 | 4 | author: [] |
5 | 5 | license: unknown |
6 | 6 | distribution_type: module |
7 | 7 | configure_requires: |
8 | 8 | ExtUtils::MakeMaker: 0 |
9 | build_requires: | |
10 | ExtUtils::MakeMaker: 0 | |
9 | 11 | requires: |
10 | IO::Pty: 1.00 | |
12 | IO::Pty: 1.08 | |
11 | 13 | Test::More: 0.47 |
12 | 14 | no_index: |
13 | 15 | directory: |
14 | 16 | - t |
15 | 17 | - inc |
16 | generated_by: ExtUtils::MakeMaker version 6.48 | |
18 | generated_by: ExtUtils::MakeMaker version 6.50 | |
17 | 19 | meta-spec: |
18 | 20 | url: http://module-build.sourceforge.net/META-spec-v1.4.html |
19 | 21 | version: 1.4 |
8 | 8 | warn("WARNING: \"IO::Pty not found\".\nWARNING: '<pty<', '>pty>' will not work.\n\n"); |
9 | 9 | last; |
10 | 10 | } |
11 | $PREREQ_PM{'IO::Pty'} = '1.00'; | |
11 | $PREREQ_PM{'IO::Pty'} = '1.08'; | |
12 | 12 | } |
13 | 13 | } else { |
14 | $PREREQ_PM{'Win32::Process'} = 0; | |
14 | $PREREQ_PM{'Win32::Process'} = '0.14'; | |
15 | 15 | if ( ! eval "use Socket qw( IPPROTO_TCP TCP_NODELAY ); 1" ) { |
16 | 16 | warn <<"TOHERE"; |
17 | 17 | $@ |
40 | 40 | |
41 | 41 | WriteMakefile( |
42 | 42 | NAME => 'IPC::Run', |
43 | ABSTRACT => 'system() and background procs w/ piping, redirs, ptys (Unix, Win32)', | |
43 | 44 | VERSION_FROM => 'lib/IPC/Run.pm', |
44 | 45 | PREREQ_PM => { |
45 | 46 | Test::More => '0.47', |
13 | 13 | # Can do I/O to sub refs and filenames, too: |
14 | 14 | run \@cmd, '<', "in.txt", \&out, \&err or die "cat: $?" |
15 | 15 | run \@cat, '<', "in.txt", '>>', "out.txt", '2>>', "err.txt"; |
16 | ||
16 | 17 | |
17 | 18 | # Redirecting using psuedo-terminals instad of pipes. |
18 | 19 | run \@cat, '<pty<', \$in, '>pty>', \$out_and_err; |
408 | 409 | processes are also specified: |
409 | 410 | |
410 | 411 | run io( "infile", ">", \$in ), io( "outfile", "<", \$in ); |
411 | ||
412 | ||
412 | 413 | as can IPC::Run::Timer objects: |
413 | 414 | |
414 | 415 | run \@cmd, io( "outfile", "<", \$in ), timeout( 10 ); |
484 | 485 | leading '|' consumes descriptor 0, so this works as expected. |
485 | 486 | |
486 | 487 | run \@cmd1, \$in, '|', \@cmd2, \$out; |
487 | ||
488 | ||
488 | 489 | The parameter following a redirection operator can be a scalar ref, a |
489 | 490 | subroutine ref, a file name, an open filehandle, or a closed filehandle. |
490 | 491 | |
665 | 666 | |
666 | 667 | <pipe, N<pipe P Pipe opens H for caller to read, write, close. |
667 | 668 | >pipe, N>pipe P Pipe opens H for caller to read, write, close. |
668 | ||
669 | ||
669 | 670 | 'N' and 'M' are placeholders for integer file descriptor numbers. The |
670 | 671 | terms 'input' and 'output' are from the child process's perspective. |
671 | 672 | |
713 | 714 | |
714 | 715 | run \@a, *IN; ## INVALID |
715 | 716 | run \@a, '<', *IN; ## BUGGY: Reads file named like "*main::A" |
716 | ||
717 | ||
717 | 718 | because perl passes a scalar containing a string that looks like |
718 | 719 | "*main::A" to &run, and &run can't tell the difference between that |
719 | 720 | and a redirection operator or a file name. &run guarantees that any |
1184 | 1185 | kill all the children. Call "<$h-"kill_kill>> in this case if you |
1185 | 1186 | care. This differs from the behavior of "run". |
1186 | 1187 | |
1188 | result | |
1187 | 1189 | $h->result; |
1188 | 1190 | |
1189 | 1191 | Returns the first non-zero result code (ie $? >> 8). See |
1699 | 1701 | Barrie Slaymaker <barries@slaysys.com> |
1700 | 1702 | |
1701 | 1703 | COPYRIGHT |
1702 | Some parts copyright 2008 Adam Kennedy. | |
1704 | Some parts copyright 2008 - 2009 Adam Kennedy. | |
1703 | 1705 | |
1704 | 1706 | Copyright 1999 Barrie Slaymaker. |
1705 | 1707 |
69 | 69 | use Exporter; |
70 | 70 | use vars qw{$VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS}; |
71 | 71 | BEGIN { |
72 | $VERSION = '0.82'; | |
72 | $VERSION = '0.84'; | |
73 | 73 | @ISA = qw( Exporter ); |
74 | 74 | @EXPORT = qw( |
75 | 75 | _debug |
82 | 82 | |
83 | 83 | use vars qw{$VERSION}; |
84 | 84 | BEGIN { |
85 | $VERSION = '0.82'; | |
85 | $VERSION = '0.84'; | |
86 | 86 | if ( Win32_MODE ) { |
87 | 87 | eval "use IPC::Run::Win32Helper; require IPC::Run::Win32IO; 1" |
88 | 88 | or ( $@ && die ) or die "$!"; |
219 | 219 | return $self; |
220 | 220 | } |
221 | 221 | |
222 | =pod | |
223 | ||
224 | =over | |
225 | ||
222 | 226 | =item filename |
223 | 227 | |
224 | 228 | Gets/sets the filename. Returns the value after the name change, if |
231 | 235 | $self->{FILENAME} = shift if @_; |
232 | 236 | return $self->{FILENAME}; |
233 | 237 | } |
238 | ||
239 | =pod | |
234 | 240 | |
235 | 241 | =item init |
236 | 242 |
162 | 162 | use Exporter; |
163 | 163 | use vars qw( $VERSION @ISA @EXPORT_OK %EXPORT_TAGS ); |
164 | 164 | BEGIN { |
165 | $VERSION = '0.82'; | |
165 | $VERSION = '0.84'; | |
166 | 166 | @ISA = qw( Exporter ); |
167 | 167 | @EXPORT_OK = qw( |
168 | 168 | check |
674 | 674 | |
675 | 675 | =pod |
676 | 676 | |
677 | =back | |
678 | ||
677 | 679 | =head1 TODO |
678 | 680 | |
679 | 681 | use Time::HiRes; if it's present. |
23 | 23 | use IO::Handle; |
24 | 24 | use vars qw{ $VERSION @ISA @EXPORT }; |
25 | 25 | BEGIN { |
26 | $VERSION = '0.82'; | |
26 | $VERSION = '0.84'; | |
27 | 27 | @ISA = qw( Exporter ); |
28 | 28 | @EXPORT = qw( |
29 | 29 | win32_spawn |
30 | 30 | |
31 | 31 | use vars qw{$VERSION}; |
32 | 32 | BEGIN { |
33 | $VERSION = '0.82'; | |
33 | $VERSION = '0.84'; | |
34 | 34 | } |
35 | 35 | |
36 | 36 | use Socket qw( IPPROTO_TCP TCP_NODELAY ); |
28 | 28 | use strict; |
29 | 29 | use vars qw{$VERSION}; |
30 | 30 | BEGIN { |
31 | $VERSION = '0.82'; | |
31 | $VERSION = '0.84'; | |
32 | 32 | } |
33 | 33 | |
34 | 34 | use Win32API::File qw( |
1004 | 1004 | |
1005 | 1005 | =head1 ROUTINES |
1006 | 1006 | |
1007 | =over | |
1008 | ||
1009 | 1007 | =cut |
1010 | 1008 | |
1011 | 1009 | use strict; |
1012 | 1010 | use Exporter (); |
1013 | 1011 | use vars qw{$VERSION @ISA @FILTER_IMP @FILTERS @API @EXPORT_OK %EXPORT_TAGS}; |
1014 | 1012 | BEGIN { |
1015 | $VERSION = '0.82'; | |
1013 | $VERSION = '0.84'; | |
1016 | 1014 | @ISA = qw{ Exporter }; |
1017 | 1015 | |
1018 | 1016 | ## We use @EXPORT for the end user's convenience: there's only one function |
1402 | 1400 | |
1403 | 1401 | =pod |
1404 | 1402 | |
1403 | =over | |
1404 | ||
1405 | 1405 | =item run |
1406 | 1406 | |
1407 | 1407 | Run takes a harness or harness specification and runs it, pumping |
1647 | 1647 | # if $options && defined $options->{debug}; |
1648 | 1648 | |
1649 | 1649 | my @args; |
1650 | ||
1651 | 1650 | if ( @_ == 1 && ! ref $_[0] ) { |
1652 | 1651 | if ( Win32_MODE ) { |
1653 | @args = ( [ qw( command /c ), win32_parse_cmd_line $_[0] ] ); | |
1652 | my $command = $ENV{ComSpec} || 'cmd'; | |
1653 | @args = ( [ $command, '/c', win32_parse_cmd_line $_[0] ] ); | |
1654 | 1654 | } |
1655 | 1655 | else { |
1656 | 1656 | @args = ( [ qw( sh -c ), @_ ] ); |
3458 | 3458 | } |
3459 | 3459 | |
3460 | 3460 | =pod |
3461 | ||
3461 | 3462 | =item result |
3462 | 3463 | |
3463 | 3464 | $h->result; |
4352 | 4353 | |
4353 | 4354 | =head1 COPYRIGHT |
4354 | 4355 | |
4355 | Some parts copyright 2008 Adam Kennedy. | |
4356 | Some parts copyright 2008 - 2009 Adam Kennedy. | |
4356 | 4357 | |
4357 | 4358 | Copyright 1999 Barrie Slaymaker. |
4358 | 4359 |
0 | #!/usr/bin/perl | |
1 | ||
2 | # Test that our META.yml file matches the current specification. | |
3 | ||
4 | use strict; | |
5 | BEGIN { | |
6 | $| = 1; | |
7 | $^W = 1; | |
8 | } | |
9 | ||
10 | my $MODULE = 'Test::CPAN::Meta 0.12'; | |
11 | ||
12 | # Don't run tests for installs | |
13 | use Test::More; | |
14 | unless ( $ENV{AUTOMATED_TESTING} or $ENV{RELEASE_TESTING} ) { | |
15 | plan( skip_all => "Author tests not required for installation" ); | |
16 | } | |
17 | ||
18 | # Load the testing module | |
19 | eval "use $MODULE"; | |
20 | if ( $@ ) { | |
21 | $ENV{RELEASE_TESTING} | |
22 | ? die( "Failed to load required release-testing module $MODULE" ) | |
23 | : plan( skip_all => "$MODULE not available for testing" ); | |
24 | } | |
25 | ||
26 | meta_yaml_ok(); |
0 | #!/usr/bin/perl | |
1 | ||
2 | # Test that the syntax of our POD documentation is valid | |
3 | ||
4 | use strict; | |
5 | BEGIN { | |
6 | $| = 1; | |
7 | $^W = 1; | |
8 | } | |
9 | ||
10 | my @MODULES = ( | |
11 | 'Pod::Simple 3.07', | |
12 | 'Test::Pod 1.26', | |
13 | ); | |
14 | ||
15 | # Don't run tests for installs | |
16 | use Test::More; | |
17 | unless ( $ENV{AUTOMATED_TESTING} or $ENV{RELEASE_TESTING} ) { | |
18 | plan( skip_all => "Author tests not required for installation" ); | |
19 | } | |
20 | ||
21 | # Load the testing modules | |
22 | foreach my $MODULE ( @MODULES ) { | |
23 | eval "use $MODULE"; | |
24 | if ( $@ ) { | |
25 | $ENV{RELEASE_TESTING} | |
26 | ? die( "Failed to load required release-testing module $MODULE" ) | |
27 | : plan( skip_all => "$MODULE not available for testing" ); | |
28 | } | |
29 | } | |
30 | ||
31 | all_pod_files_ok(); |
0 | #!/usr/bin/perl | |
1 | ||
2 | # Test that our declared minimum Perl version matches our syntax | |
3 | ||
4 | use strict; | |
5 | BEGIN { | |
6 | $| = 1; | |
7 | $^W = 1; | |
8 | } | |
9 | ||
10 | my @MODULES = ( | |
11 | 'Perl::MinimumVersion 1.20', | |
12 | 'Test::MinimumVersion 0.008', | |
13 | ); | |
14 | ||
15 | # Don't run tests for installs | |
16 | use Test::More; | |
17 | unless ( $ENV{AUTOMATED_TESTING} or $ENV{RELEASE_TESTING} ) { | |
18 | plan( skip_all => "Author tests not required for installation" ); | |
19 | } | |
20 | ||
21 | # Load the testing modules | |
22 | foreach my $MODULE ( @MODULES ) { | |
23 | eval "use $MODULE"; | |
24 | if ( $@ ) { | |
25 | $ENV{RELEASE_TESTING} | |
26 | ? die( "Failed to load required release-testing module $MODULE" ) | |
27 | : plan( skip_all => "$MODULE not available for testing" ); | |
28 | } | |
29 | } | |
30 | ||
31 | all_minimum_version_from_metayml_ok(); |
98 | 98 | |
99 | 99 | ## Older Perls can't ok( a, qr// ), so I manually do that here. |
100 | 100 | my $exp; |
101 | my $platform_skip = $^O =~ /(?:aix|freebsd|openbsd)/ ? "$^O deadlocks on this test" : ""; | |
101 | my $platform_skip = $^O =~ /(?:aix|freebsd|openbsd|darwin)/ ? "$^O deadlocks on this test" : ""; | |
102 | 102 | |
103 | 103 | ## |
104 | 104 | ## stdin only |
786 | 786 | ok( $r ); |
787 | 787 | ok( ! $? ); |
788 | 788 | is( _map_fds, $fd_map ); |
789 | ok( $out =~ qr/^(?:HELLO World\n|Hello world\n){2}$/s ); | |
790 | ok( $err =~ qr/^(?:[12]:Hello World.*){2}$/s ); | |
789 | ok( $out =~ qr/^(?:HELLO World\n|Hello world\n){2}\z/s ); | |
790 | ok( $err =~ qr/^(?:[12]:Hello World.*){2}\z/s ); | |
791 | 791 | |
792 | 792 | ## |
793 | 793 | ## A few error cases... |