Codebase list libipc-run-perl / 98fee93
[svn-upgrade] Integrating new upstream version, libipc-run-perl (0.84) Gunnar Wolf 14 years ago
17 changed file(s) with 140 addition(s) and 26 deletion(s). Raw diff Collapse all Expand all
00 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.
17
28 0.82 Thu 18 Dec 2008
39 - Moving changes in 0.81_01 to a production release
2020 Makefile.PL
2121 MANIFEST This list of files
2222 README
23 t/97_meta.t
24 t/98_pod.t
25 t/99_pmv.t
2326 t/adopt.t
2427 t/binmode.t
2528 t/bogus.t
00 --- #YAML:1.0
11 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)
44 author: []
55 license: unknown
66 distribution_type: module
77 configure_requires:
88 ExtUtils::MakeMaker: 0
9 build_requires:
10 ExtUtils::MakeMaker: 0
911 requires:
10 IO::Pty: 1.00
12 IO::Pty: 1.08
1113 Test::More: 0.47
1214 no_index:
1315 directory:
1416 - t
1517 - inc
16 generated_by: ExtUtils::MakeMaker version 6.48
18 generated_by: ExtUtils::MakeMaker version 6.50
1719 meta-spec:
1820 url: http://module-build.sourceforge.net/META-spec-v1.4.html
1921 version: 1.4
88 warn("WARNING: \"IO::Pty not found\".\nWARNING: '<pty<', '>pty>' will not work.\n\n");
99 last;
1010 }
11 $PREREQ_PM{'IO::Pty'} = '1.00';
11 $PREREQ_PM{'IO::Pty'} = '1.08';
1212 }
1313 } else {
14 $PREREQ_PM{'Win32::Process'} = 0;
14 $PREREQ_PM{'Win32::Process'} = '0.14';
1515 if ( ! eval "use Socket qw( IPPROTO_TCP TCP_NODELAY ); 1" ) {
1616 warn <<"TOHERE";
1717 $@
4040
4141 WriteMakefile(
4242 NAME => 'IPC::Run',
43 ABSTRACT => 'system() and background procs w/ piping, redirs, ptys (Unix, Win32)',
4344 VERSION_FROM => 'lib/IPC/Run.pm',
4445 PREREQ_PM => {
4546 Test::More => '0.47',
1313 # Can do I/O to sub refs and filenames, too:
1414 run \@cmd, '<', "in.txt", \&out, \&err or die "cat: $?"
1515 run \@cat, '<', "in.txt", '>>', "out.txt", '2>>', "err.txt";
16
1617
1718 # Redirecting using psuedo-terminals instad of pipes.
1819 run \@cat, '<pty<', \$in, '>pty>', \$out_and_err;
408409 processes are also specified:
409410
410411 run io( "infile", ">", \$in ), io( "outfile", "<", \$in );
411
412
412413 as can IPC::Run::Timer objects:
413414
414415 run \@cmd, io( "outfile", "<", \$in ), timeout( 10 );
484485 leading '|' consumes descriptor 0, so this works as expected.
485486
486487 run \@cmd1, \$in, '|', \@cmd2, \$out;
487
488
488489 The parameter following a redirection operator can be a scalar ref, a
489490 subroutine ref, a file name, an open filehandle, or a closed filehandle.
490491
665666
666667 <pipe, N<pipe P Pipe opens H for caller to read, write, close.
667668 >pipe, N>pipe P Pipe opens H for caller to read, write, close.
668
669
669670 'N' and 'M' are placeholders for integer file descriptor numbers. The
670671 terms 'input' and 'output' are from the child process's perspective.
671672
713714
714715 run \@a, *IN; ## INVALID
715716 run \@a, '<', *IN; ## BUGGY: Reads file named like "*main::A"
716
717
717718 because perl passes a scalar containing a string that looks like
718719 "*main::A" to &run, and &run can't tell the difference between that
719720 and a redirection operator or a file name. &run guarantees that any
11841185 kill all the children. Call "<$h-"kill_kill>> in this case if you
11851186 care. This differs from the behavior of "run".
11861187
1188 result
11871189 $h->result;
11881190
11891191 Returns the first non-zero result code (ie $? >> 8). See
16991701 Barrie Slaymaker <barries@slaysys.com>
17001702
17011703 COPYRIGHT
1702 Some parts copyright 2008 Adam Kennedy.
1704 Some parts copyright 2008 - 2009 Adam Kennedy.
17031705
17041706 Copyright 1999 Barrie Slaymaker.
17051707
6969 use Exporter;
7070 use vars qw{$VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS};
7171 BEGIN {
72 $VERSION = '0.82';
72 $VERSION = '0.84';
7373 @ISA = qw( Exporter );
7474 @EXPORT = qw(
7575 _debug
8282
8383 use vars qw{$VERSION};
8484 BEGIN {
85 $VERSION = '0.82';
85 $VERSION = '0.84';
8686 if ( Win32_MODE ) {
8787 eval "use IPC::Run::Win32Helper; require IPC::Run::Win32IO; 1"
8888 or ( $@ && die ) or die "$!";
219219 return $self;
220220 }
221221
222 =pod
223
224 =over
225
222226 =item filename
223227
224228 Gets/sets the filename. Returns the value after the name change, if
231235 $self->{FILENAME} = shift if @_;
232236 return $self->{FILENAME};
233237 }
238
239 =pod
234240
235241 =item init
236242
162162 use Exporter;
163163 use vars qw( $VERSION @ISA @EXPORT_OK %EXPORT_TAGS );
164164 BEGIN {
165 $VERSION = '0.82';
165 $VERSION = '0.84';
166166 @ISA = qw( Exporter );
167167 @EXPORT_OK = qw(
168168 check
674674
675675 =pod
676676
677 =back
678
677679 =head1 TODO
678680
679681 use Time::HiRes; if it's present.
2323 use IO::Handle;
2424 use vars qw{ $VERSION @ISA @EXPORT };
2525 BEGIN {
26 $VERSION = '0.82';
26 $VERSION = '0.84';
2727 @ISA = qw( Exporter );
2828 @EXPORT = qw(
2929 win32_spawn
3030
3131 use vars qw{$VERSION};
3232 BEGIN {
33 $VERSION = '0.82';
33 $VERSION = '0.84';
3434 }
3535
3636 use Socket qw( IPPROTO_TCP TCP_NODELAY );
2828 use strict;
2929 use vars qw{$VERSION};
3030 BEGIN {
31 $VERSION = '0.82';
31 $VERSION = '0.84';
3232 }
3333
3434 use Win32API::File qw(
10041004
10051005 =head1 ROUTINES
10061006
1007 =over
1008
10091007 =cut
10101008
10111009 use strict;
10121010 use Exporter ();
10131011 use vars qw{$VERSION @ISA @FILTER_IMP @FILTERS @API @EXPORT_OK %EXPORT_TAGS};
10141012 BEGIN {
1015 $VERSION = '0.82';
1013 $VERSION = '0.84';
10161014 @ISA = qw{ Exporter };
10171015
10181016 ## We use @EXPORT for the end user's convenience: there's only one function
14021400
14031401 =pod
14041402
1403 =over
1404
14051405 =item run
14061406
14071407 Run takes a harness or harness specification and runs it, pumping
16471647 # if $options && defined $options->{debug};
16481648
16491649 my @args;
1650
16511650 if ( @_ == 1 && ! ref $_[0] ) {
16521651 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] ] );
16541654 }
16551655 else {
16561656 @args = ( [ qw( sh -c ), @_ ] );
34583458 }
34593459
34603460 =pod
3461
34613462 =item result
34623463
34633464 $h->result;
43524353
43534354 =head1 COPYRIGHT
43544355
4355 Some parts copyright 2008 Adam Kennedy.
4356 Some parts copyright 2008 - 2009 Adam Kennedy.
43564357
43574358 Copyright 1999 Barrie Slaymaker.
43584359
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();
9898
9999 ## Older Perls can't ok( a, qr// ), so I manually do that here.
100100 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" : "";
102102
103103 ##
104104 ## stdin only
786786 ok( $r );
787787 ok( ! $? );
788788 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 );
791791
792792 ##
793793 ## A few error cases...