Subject: | Patch to allow building without prompts |
This patch will allow people to include DBD::Sybase as part of an
automated build process.
Subject: | dbd_sybase_defaults.patch |
diff -Naur old/Makefile.PL new/Makefile.PL
--- old/Makefile.PL 2005-04-09 19:02:35.000000000 +1000
+++ new/Makefile.PL 2006-08-17 07:00:24.000000000 +1000
@@ -20,7 +20,9 @@
$written_pwd_file = 'PWD';
my $file;
-GetOptions('--file' => \$file);
+my $chained;
+my $accept_test_defaults;
+GetOptions('--file' => \$file, '--chained:s', \$chained, '--accept-test-defaults', \$accept_test_defaults);
select(STDOUT); $| = 1;
@@ -344,16 +346,23 @@
}
close(IN);
- print "The DBD::Sybase module need access to a Sybase server to run the tests.\n";
- print "To clear an entry please enter 'undef'\n";
- print "Sybase server to use (default: $pwd{SRV}): ";
- $pwd{SRV} = getAns(0) || $pwd{SRV};
- print "User ID to log in to Sybase (default: $pwd{UID}): ";
- $pwd{UID} = getAns(0) || $pwd{UID};
- print "Password (default: $pwd{PWD}): ";
- $pwd{PWD} = getAns(1) || $pwd{PWD};
- print "Sybase database to use on $pwd{SRV} (default: $pwd{DB}): ";
- $pwd{DB} = getAns(0) || $pwd{DB};
+ if ($accept_test_defaults) {
+ $pwd{SRV} = $pwd{SRV};
+ $pwd{UID} = $pwd{UID};
+ $pwd{PWD} = $pwd{PWD};
+ $pwd{DB} = $pwd{DB};
+ } else {
+ print "The DBD::Sybase module need access to a Sybase server to run the tests.\n";
+ print "To clear an entry please enter 'undef'\n";
+ print "Sybase server to use (default: $pwd{SRV}): ";
+ $pwd{SRV} = getAns(0) || $pwd{SRV};
+ print "User ID to log in to Sybase (default: $pwd{UID}): ";
+ $pwd{UID} = getAns(0) || $pwd{UID};
+ print "Password (default: $pwd{PWD}): ";
+ $pwd{PWD} = getAns(1) || $pwd{PWD};
+ print "Sybase database to use on $pwd{SRV} (default: $pwd{DB}): ";
+ $pwd{DB} = getAns(0) || $pwd{DB};
+ }
warn "\n* Writing login information, including password, to file $written_pwd_file.\n\n";
# Create the file non-readable by anyone else.
@@ -391,7 +400,12 @@
EOF
print "Use 'CHAINED' mode by default (Y/N) [Y]: ";
- my $ans = getAns(0);
+ my $ans;
+ if (defined $chained) {
+ $ans = $chained;
+ } else {
+ $ans = getAns(0);
+ }
if($ans and $ans !~ /^y/i) {
$inc_string .= " -DNO_CHAINED_TRAN=1";
}