Subject: | Use prompt() in Makefile.PL to Allow Automated Tests |
Dear Jörn Reder,
Hi. This is imacat from Taiwan. I'm currently helping to run smoke
tests for CPAN modules. I found that the Makefile.PL of
MPEG-MP3Play-0.15 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
Xaudio SDK 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 MPEG-MP3Play-0.15, 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: | MPEG-MP3Play-0.15-prompt.diff |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
diff -u -r MPEG-MP3Play-0.15.orig/Makefile.PL MPEG-MP3Play-0.15/Makefile.PL
- --- MPEG-MP3Play-0.15.orig/Makefile.PL 2001-01-06 06:05:31.000000000 +0800
+++ MPEG-MP3Play-0.15/Makefile.PL 2008-03-30 01:02:36.000000000 +0800
@@ -94,12 +94,10 @@
$sdk_dir = $SDK_DIR;
do {
- - print "Xaudio SDK directory [$sdk_dir] : ";
- - my $input;
- - chomp ($input = <STDIN>);
+ my $input = prompt("Xaudio SDK directory [$sdk_dir] :");
$sdk_dir = $input if $input;
- - $sdk_dir =~ s!/$!!;
$ok = -d "$sdk_dir/include" and -d "$sdk_dir/lib";
+ exit 0 if !$input && !$ok;
print "\nHmm, the directory must contain include and lib subdirectories.\n".
"Try again or press Ctrl+C to abort.\n\n"
if not $ok;
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAkfudrgACgkQi9gubzC5S1xeyACfZqmQIunFwOL7s2fXjYmm7a+l
l6cAoK3wp+sZjxdp2ZELIzJcfosfFmGu
=uiMt
-----END PGP SIGNATURE-----