Skip Menu |

This queue is for tickets about the Apache-Compress CPAN distribution.

Report information
The Basics
Id: 34602
Status: new
Priority: 0/
Queue: Apache-Compress

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

Bug Information
Severity: Normal
Broken in: 1.005
Fixed in: (no value)



Subject: Use prompt() in Makefile.PL to Allow Automated Tests
Dear Ken Williams, Hi. This is imacat from Taiwan. I found that the Makefile.PL of Apache-Compress-1.005 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 httpd 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 Apache-Compress-1.005, in the hope that it helps. Please tell me if you have any question, or if I could be of any help. Thank you.
Subject: Apache-Compress-1.005-prompt.diff
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 diff -u -r Apache-Compress-1.005.orig/t/lib/Apache/test.pm Apache-Compress-1.005/t/lib/Apache/test.pm - --- Apache-Compress-1.005.orig/t/lib/Apache/test.pm 2004-11-18 04:01:14.000000000 +0800 +++ Apache-Compress-1.005/t/lib/Apache/test.pm 2008-04-02 06:06:42.000000000 +0800 @@ -5,6 +5,7 @@ use Exporter (); use Config; use FileHandle (); +use ExtUtils::MakeMaker; *import = \&Exporter::import; @EXPORT = qw(test fetch simple_fetch have_module skip_test @@ -90,9 +91,11 @@ my $response; do { - - print "$prompt [$default]: "; - - chomp($response = <STDIN>); - - $response ||= $default; + $response = prompt($prompt, $default); + if ($mustfind && $response eq $default && !-e $response) { + print("Cannot continue\n"); + exit 0; + } } until (!$mustfind || (-e $response || !print("$response not found\n"))); return $response; -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkfyshAACgkQi9gubzC5S1wQwgCgriqdKhlKOSq8OaFjcTBO1hut aQYAnRZZIG18sgk0tMaLAKLFWLqfT/Wm =oiGR -----END PGP SIGNATURE-----