From: dms Date: Tue, 5 Sep 2000 15:47:07 +0000 (+0000) Subject: forgot to update these files in the root dir overhaul X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=4e07fc46b0f83df0c8bd2d87630bb865227453a7;p=infobot.git forgot to update these files in the root dir overhaul git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@71 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/blootbot/scripts/dbm2mysql.pl b/blootbot/scripts/dbm2mysql.pl index d963c4f..c64c375 100755 --- a/blootbot/scripts/dbm2mysql.pl +++ b/blootbot/scripts/dbm2mysql.pl @@ -2,15 +2,17 @@ # by the xk. ### -require "src/logger.pl"; require "src/core.pl"; +require "src/logger.pl"; +require "src/modules.pl"; require "src/Misc.pl"; require "src/Files.pl"; +&loadDBModules(); package MYSQL; -require "src/Factoids/db_mysql.pl"; +require "src/db_mysql.pl"; package DBM; -require "src/Factoids/db_dbm.pl"; +require "src/db_dbm.pl"; package main; if (!scalar @ARGV) { @@ -26,8 +28,8 @@ my %db; ### open all the data... &loadConfig("files/blootbot.config"); -$dbname = $param{'DBFile'}; -my $dbh_mysql = MYSQL::openDB(); +$dbname = $param{'DBName'}; +my $dbh_mysql = MYSQL::openDB($param{'DBName'}, $param{'SQLUser'}, $param{'SQLPass'}); DBM::openDB(); print "scalar db == '". scalar(keys %db) ."'.\n"; @@ -49,3 +51,4 @@ foreach $factoid (keys %db) { } print "Done.\n"; +&closeDB(); diff --git a/blootbot/scripts/mysql2txt.pl b/blootbot/scripts/mysql2txt.pl index c1a2c93..53f3b77 100755 --- a/blootbot/scripts/mysql2txt.pl +++ b/blootbot/scripts/mysql2txt.pl @@ -21,7 +21,7 @@ if (!defined $dbname) { &loadConfig("files/blootbot.config"); &loadDBModules(); -&openDB(); +&openDB($param{'DBName'}, $param{'SQLUser'}, $param{'SQLPass'}); # retrieve a list of db's from the server. my %db; diff --git a/blootbot/scripts/setup_tables.pl b/blootbot/scripts/setup_tables.pl index 7c71ac4..d2e7cca 100755 --- a/blootbot/scripts/setup_tables.pl +++ b/blootbot/scripts/setup_tables.pl @@ -23,7 +23,7 @@ if ($dbname eq "") { if ($param{'DBType'} =~ /mysql/i) { use DBI; - &openDB(); + &openDB($param{'DBName'}, $param{'SQLUser'}, $param{'SQLPass'}); # retrieve a list of db's from the server. my %db; diff --git a/blootbot/scripts/setup_users.pl b/blootbot/scripts/setup_users.pl index ed76ced..9c1c200 100755 --- a/blootbot/scripts/setup_users.pl +++ b/blootbot/scripts/setup_users.pl @@ -21,28 +21,6 @@ if ($dbname eq "") { } if ($param{'DBType'} =~ /mysql/i) { - if (!scalar @ARGV) { - print "hi there.\n\n"; - - print "if you're running a new version of mysql (debian potato), run\n"; - print "this script with the '1' parameter while '0' for older versions\n"; - print "(debian slink).\n"; - exit 0; - } - - my $mysqlversion; - if ($ARGV[0] =~ /^\d+$/) { - if ($ARGV[0] == 0) { - $mysqlversion = 0; - } elsif ($ARGV[0] == 1) { - $mysqlversion = 1; - } else { - print "error: wrong integer?\n"; - } - } else { - print "error: wrong argument?\n"; - exit 1; - } print "Enter root information...\n"; # username. @@ -65,7 +43,7 @@ if ($param{'DBType'} =~ /mysql/i) { print "Step 1: Adding user information.\n"; # open the db. - &openDB("mysql"); + &openDB("mysql", $adminuser, $adminpass); # Step 2. if (!&dbGet("user","user",$param{'SQLUser'},"user")) { @@ -75,11 +53,8 @@ if ($param{'DBType'} =~ /mysql/i) { "('localhost', '$param{'SQLUser'}', ". "password('$param{'SQLPass'}'), "; - if ($mysqlversion) { - $query .= "'Y','Y','Y','Y','N','N','N','N','N','N','N','N','N','N')"; - } else { - $query .= "'Y','Y','Y','Y','N','N','N','N','N','N')"; - } + $query .= "'Y','Y','Y','Y','N','N','N','N','N','N','N','N','N','N')"; +### $query .= "'Y','Y','Y','Y','N','N','N','N','N','N')"; &dbRaw("create(user)", $query); } @@ -92,11 +67,8 @@ if ($param{'DBType'} =~ /mysql/i) { "('localhost', '$dbname', ". "'$param{'SQLUser'}', "; - if ($mysqlversion) { - $query .= "'Y','Y','Y','Y','Y','N','N','N','N','N')"; - } else { - $query .= "'Y','Y','Y','Y','Y','N')"; - } + $query .= "'Y','Y','Y','Y','Y','N','N','N','N','N')"; +### $query .= "'Y','Y','Y','Y','Y','N')"; &dbRaw("create(db)", $query); } diff --git a/blootbot/scripts/txt2mysql.pl b/blootbot/scripts/txt2mysql.pl index 4c52369..47a70b7 100755 --- a/blootbot/scripts/txt2mysql.pl +++ b/blootbot/scripts/txt2mysql.pl @@ -21,7 +21,7 @@ open(IN,$txtfile) or die "error: cannot open txtfile '$txtfile'.\n"; # read the bot config file. &loadConfig("files/blootbot.config"); &loadDBModules(); -&openDB(); +&openDB($param{'DBName'}, $param{'SQLUser'}, $param{'SQLPass'}); ### now pipe all the data to the mysql server... my $i = 1;