]> git.donarmstrong.com Git - infobot.git/commitdiff
forgot to update these files in the root dir overhaul
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Tue, 5 Sep 2000 15:47:07 +0000 (15:47 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Tue, 5 Sep 2000 15:47:07 +0000 (15:47 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@71 c11ca15a-4712-0410-83d8-924469b57eb5

scripts/dbm2mysql.pl
scripts/mysql2txt.pl
scripts/setup_tables.pl
scripts/setup_users.pl
scripts/txt2mysql.pl

index d963c4fbbea545861291772a56e03ef18ec38dad..c64c375e4a40d4bdfa57ba0cb707d88879fcc969 100755 (executable)
@@ -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();
index c1a2c9364a34f5c01b4cfebc5c59873a4bf45469..53f3b7763f29247fbdc3f4f057702cb49e6950b8 100755 (executable)
@@ -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;
index 7c71ac457c8e99c7fe7a7fa671463efd370070c3..d2e7cca2da275fcccf307746e70e4cc3058ca212 100755 (executable)
@@ -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;
index ed76ced5207a343f6de82f5230dd1630700f1873..9c1c200a97d74ab384b84e796f9c882d79a48d6c 100755 (executable)
@@ -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);
     }
index 4c5236966ac43af691cedacdb3708f13dd0531f3..47a70b7437c0b24d18a4a3ad0da0a953bab60442 100755 (executable)
@@ -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;