From 56a369164b96f55d5e17b8ca05e020f5d6623160 Mon Sep 17 00:00:00 2001 From: lissav Date: Fri, 27 Aug 2010 11:31:50 +0000 Subject: [PATCH] no support for sqlite git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7273 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/sbin/runsqlcmd | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/xCAT-server/sbin/runsqlcmd b/xCAT-server/sbin/runsqlcmd index 65b2f4d9b..81ce44b8d 100755 --- a/xCAT-server/sbin/runsqlcmd +++ b/xCAT-server/sbin/runsqlcmd @@ -90,6 +90,11 @@ my @sqlfilelist = xCAT::Table->get_filelist($directory, \@filearray, "sql"); # determine database my $xcatcfg = xCAT::Table->get_xcatcfg(); +if ($xcatcfg =~ /^SQLite:/) +{ + xCAT::MsgUtils->message("SE", + "The runsqlcmd does not support the SQLite database."); +} foreach my $file (@sqlfilelist) { if ($xcatcfg =~ /^DB2:/) @@ -106,12 +111,14 @@ foreach my $file (@sqlfilelist) } if ($xcatcfg =~ /^SQLite:/) { + # not supported but will leave routine in case we change our mind &runsqlitecmd($file,$xcatcfg); + exit 1; } } -exit; +exit 0; ##################################### # subroutines @@ -131,10 +138,10 @@ sub usage { xCAT::MsgUtils->message( 'I', - "Usage:\nrunsqlcmd - runs the sql commands in files located in /opt/xcat/lib/perl/xCAT_schema by default or the directory input with -d or the list of files input with the -f flag." + "Usage:\nRuns the sql commands in files located in /opt/xcat/lib/perl/xCAT_schema by default or the directory input with -d or the list of files input with the -f flag. Supports DB2,PostgreSQL,MySQL." ); my $msg = - "runsqlcmd <-h|--help>\n <-v|--version>\n <-d|--dir>\n <-f|--files>\n"; + "runsqlcmd <-h|--help>\n <-v|--version>\n <-d|--dir>\n <-f|--files>\n"; xCAT::MsgUtils->message('I', "$msg"); } @@ -285,10 +292,6 @@ sub runsqlitecmd { my $file = shift; my $xcatcfg = shift; - my ($front, $back) = split('\;', $xcatcfg); - my ($prefix, $dbname) = split('=', $front); - my ($host, $admin, $passwd) = split('\|', $back); - my ($hostind, $hostname) = split('=', $host); return; }