From c9778bf3f7f0a198a55f08c8c58b715c7d67f4dd Mon Sep 17 00:00:00 2001 From: xq2005 Date: Tue, 19 Mar 2013 08:55:04 +0000 Subject: [PATCH] setup odbc for mysql on debian/ubuntu git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@15571 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-client/bin/mysqlsetup | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/xCAT-client/bin/mysqlsetup b/xCAT-client/bin/mysqlsetup index 188477035..f9595d0e5 100755 --- a/xCAT-client/bin/mysqlsetup +++ b/xCAT-client/bin/mysqlsetup @@ -1425,6 +1425,9 @@ sub setupODBC # # for all OS need unixODBC rpm my $cmd = "rpm -qa | grep unixODBC"; + if ( $::debianflag ){ + $cmd = "dpkg -l | grep unixodbc"; + } xCAT::Utils->runcmd($cmd, 0); if ($::RUNCMD_RC != 0) { @@ -1447,6 +1450,16 @@ sub setupODBC exit(1); } } + elsif ( $::debianflag ){ + $cmd = "dpkg -l | grep libmyodbc"; + xCAT::Utils->runcmd($cmd, 0); + if ($::RUNCMD_RC != 0) + { + my $message = "\nlibmyodbc is not installed."; + xCAT::MsgUtils->message("E", " $cmd failed. $message"); + exit(1); + } + } else # sles { $cmd = "rpm -qa | grep mysql-client"; @@ -1520,6 +1533,12 @@ sub setupODBC $cmd = "rpm -ql mysql-connector-odbc | grep libmyodbc..so"; @rpmoutput = xCAT::Utils->runcmd($cmd, 0); } + elsif ( $::debianflag ){ + $odbcinstfile = "/etc/odbcinst.ini"; + $odbcfile = "/etc/odbc.ini"; + $cmd = "dpkg -L libmyodbc | grep libmyodbc.so"; + @rpmoutput = xCAT::Utils->runcmd($cmd, 0); + } else { #sles $odbcinstfile = "/etc/unixODBC/odbcinst.ini ";