Subject: | Use prompt() in Makefile.PL to Allow Automated Tests |
Dear Paul Sharpe,
Hi. This is imacat from Taiwan. I'm currently helping to run smoke
tests for CPAN modules. I found that the Makefile.PL of
DbFramework-1.10 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
I made a simple patch to DbFramework-1.10, 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: | DbFramework-1.10-prompt.diff |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
diff -u -r DbFramework-1.10.orig/Makefile.PL DbFramework-1.10/Makefile.PL
- --- DbFramework-1.10.orig/Makefile.PL 1999-05-13 22:43:04.000000000 +0800
+++ DbFramework-1.10/Makefile.PL 2008-03-30 02:32:34.000000000 +0800
@@ -17,33 +17,27 @@
Press return to continue.
EOF
- -<STDIN>;
+prompt("");
my $config = 't/Config.pm';
unless ( -f $config && yn("$config exists, use it?",1) ) {
# select drivers to test
my @drivers = qw/mysql mSQL Pg/;
- - print "Enter (space seperated) DBI drivers to test: [@drivers] ";
- - my $drivers = <STDIN>;
- - chop $drivers;
- - @drivers = split /\s/,$drivers if $drivers ne '';
+ my $drivers = prompt("Enter (space seperated) DBI drivers to test:", join(" ", @drivers));
+ @drivers = split /\s/,$drivers;
$test_db = 'dbframework_test';
my %driver;
for my $driver ( @drivers ) {
- - print "\nConfiguring for driver 'DBI:$driver'\n";
- - print "Enter the name of your test database: [$test_db] ";
- - $_ = <STDIN>; chop;
- - $test_db = $_ unless $_ eq '';
+ $test_db = prompt("\nConfiguring for driver 'DBI:$driver'\nEnter the name of your test database:", $test_db);
print "\n";
for my $db ( $catalog_db, $test_db ) {
print "Configuring database '$db'\n";
my $dsn = "DBI:$driver:$db";
- - print qq{Enter the portion of the DSN that DBD::$driver will use to connect()
- -to $db i.e. 'DBI:$driver:[dsn_string]': [$db] };
- - $_ = <STDIN>; chop;
- - $driver{$driver}->{$db}->{dsn} = ($_ ne '') ? "DBI:$driver:$_" : $dsn;
+ $_ = prompt(qq{Enter the portion of the DSN that DBD::$driver will use to connect()
+to $db i.e. 'DBI:$driver:[dsn_string]':}, $db);
+ $driver{$driver}->{$db}->{dsn} = "DBI:$driver:$_";
($driver{$driver}->{$db}->{u},$driver{$driver}->{$db}->{p})
= DbFramework::Util::get_auth();
if ( $db eq $catalog_db ) {
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAkfui9wACgkQi9gubzC5S1xE4ACdFrBKwDjoMOgw80t1F7S59vEC
SvgAn1UzFcT825JVpvpXv7jOW+Ew6d/P
=fgFO
-----END PGP SIGNATURE-----