Skip Menu |

This queue is for tickets about the P4 CPAN distribution.

Report information
The Basics
Id: 25789
Status: open
Priority: 0/
Queue: P4

People
Owner: Nobody in particular
Requestors: imacat [...] mail.imacat.idv.tw
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 3.5313
Fixed in: (no value)



Subject: Allowing Automated CPAN Tests
Dear Tony Smith, Hi. This is imacat from Taiwan. I'm current acting as a CPAN tester and running tests for all the uploaded CPAN packages daily. It seems that your P4-3.5313 does not allow automated tests. It keeps saying "Where is the Perforce API to be found:", requesting $apipath and entering an infinite loop if no STDIN is attached and no answer can be supplied, as when I'm running daily automated tests for all the uploaded CPAN packages. As a CPAN tester testing 40-50 modules per day, I really cannot test every package and check their input alone. Having such a package that does not satisfy with an empty answer with a default behavior really frustrate me as it uses up all my CPU and system resources that I can contribute to other packages that need more tests. Could you please help solving this issue, by stopping to build if nothing was obtained from STDIN? Thank you very much. You are greatly appreciated by the large CPAN family.
Subject: Use prompt() in Makefile.PL to Allow Automated Tests
Dear Tony Smith, Hi. This is imacat from Taiwan. I'm currently helping to run smoke tests for CPAN modules. I found that the Makefile.PL of P4-3.5313 goes into infinite loop if nothing is read from keyboard. I would suggest that you use prompt() instead of directly obtain input from the STDIN, as suggested in the ExtUtils::MakeMaker document, so that the it won't go into infinite loop. <<ExtUtils::MakeMaker>> Other Handy Functions http://search.cpan.org/perldoc?ExtUtils::MakeMaker#Other_Handy_Functions Also, I would suggest you to exit() with 0 from the Makefile.PL if the required Perface API fails, as suggested by this article: <<Notes For CPAN Authors> "How can I stop getting FAIL reports for missing libraries or other non-Perl dependencies?" http://cpantest.grango.org/wiki/CPANAuthorNotes I made a simple patch to P4-3.5313, in the hope that it helps. Please tell me if you have any question, or if I could be of any help. Thank you.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 diff -u -r P4-3.5313.orig/Makefile.PL P4-3.5313/Makefile.PL - --- P4-3.5313.orig/Makefile.PL 2005-08-16 22:25:19.000000000 +0800 +++ P4-3.5313/Makefile.PL 2008-03-30 15:53:13.000000000 +0800 @@ -125,9 +125,11 @@ my $apipath = ""; while( ! defined $apiver ) { - - print( "Where is the Perforce API to be found: " ); - - $apipath = <STDIN>; - - $apipath =~ s/\n//; + $apipath = prompt( "Where is the Perforce API to be found:"); + if (!$apipath) { + print "Cannot continue without the Perface API\n"; + exit 0; + } # Filthy support for ~/ type paths ( NOT ~user/ though! ) $apipath =~ s#\~/#$ENV{HOME}/#; @@ -140,8 +142,7 @@ while( !defined( encode_api_version( $apiver ) ) ) { print( "Unable to determine API version string\n" ); - - print( "Enter API version: " ); - - $apiver = <STDIN>; + $apiver = prompt( "Enter API version:" ); } $apiver = encode_api_version( $apiver ); @@ -187,10 +188,7 @@ the tests EOF - - print( "Enter the address of your Perforce server: [localhost:1666]: "); - - my $p4port = <STDIN>; - - $p4port =~ s/\n//; - - $p4port = "localhost:1666" if ( $p4port =~ /^$/ ); + my $p4port = prompt( "Enter the address of your Perforce server:", "localhost:1666" ); open( IN, "test.pl.skel" ) or die( "Can't open test.pl.skel! "); open( OUT, ">test.pl" ) or die( "Can't create test.pl" ); -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkfvRxsACgkQi9gubzC5S1yGEwCgqWwF5bgbxZDCNy0ePIYb9aZk Rr4An0jqMJHRmxZpFX8QhI954og2ORGN =1RtC -----END PGP SIGNATURE-----