[Koha-devel] installer.pl in the 1.3 branch
Ambrose Li [CCCGT]
acli at cccgt.dyn.dhs.org
Wed Nov 27 09:37:05 CET 2002
Hello,
does anyone have a rough idea how long installer.pl will continue
to be the official installer? I tried to install 1.3.2 and was
hit by "/usr/bin/mysqladmin: No such file or directory" again. My
patch for looking for mysql was lost I guess (^^;) So here it is
again (^_^)
(The MySQL password is also not quoted, not anywhere. Somehow,
fixes to bugs are being lost; we are seeing regressions, this is
not good.)
If users are expected to run installer.pl instead of reading an
INSTALL document, the installer should not have these paths hard-
coded in (e.g., if it can't find mysql, it should not expect to
find it in /usr); the school I went to would probably place mysql
in /software/mysql and koha in /software/koha ...
Regards,
--
Ambrose Li
``A good style should show no sign of effort;
what is written should seem a happy accident.'' ~ Somerset Maugham
-------------- next part --------------
--- installer.pl.dist Tue Nov 26 09:58:08 2002
+++ installer.pl Wed Nov 27 12:06:08 2002
@@ -788,17 +788,24 @@
my $mysqldir;
my $mysqluser = 'root';
my $mysqlpass = '';
+my $mysqlpass_raw = '';
foreach my $mysql (qw(/usr/local/mysql
/opt/mysql
/usr
)) {
- if ( -d $mysql ) {
+ if ( -d $mysql && -f "$mysql/bin/mysqladmin" ) {
$mysqldir=$mysql;
}
}
-if (!$mysqldir){
- $mysqldir='/usr';
+if (!defined $mysqldir){
+ print "I don't see mysql in the usual places.\n";
+ for (;;) {
+ print "Where have you installed mysql (value of --prefix if you compiled it yourself)? ";
+ chomp($mysqldir = <STDIN>);
+ last if -f "$mysqldir/bin/mysqladmin";
+ print "I can't find it there either.\n";
+ }
}
print qq|
To allow us to create the koha database please supply the
@@ -809,7 +816,10 @@
while ($needpassword) {
print "Enter mysql\'s root users password: ";
chomp($input = <STDIN>);
- $mysqlpass = $input;
+ $mysqlpass_raw = $input;
+ $mysqlpass = $mysqlpass_raw;
+ $mysqlpass =~ s/"/\\"/g;
+ $mysqlpass = "\"$mysqlpass\"";
my $result=system("$mysqldir/bin/mysqladmin -u$mysqluser -p$mysqlpass proc > /dev/null 2>&1");
if ($result) {
print "\n\nInvalid password for the MySql root user.\n\n";
More information about the Koha-devel
mailing list