summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordane dane@31f1291d-b8d6-0310-a050-a5561fc1590b <dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-04-17 15:42:25 +0000
committerdane dane@31f1291d-b8d6-0310-a050-a5561fc1590b <dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-04-17 15:42:25 +0000
commit0731a633f8735b08ef92b5111663bb2960382cef (patch)
treec3d85530163fcab0585ec789e3b8f615556b21ab
parenta7f2245085fee869e6eb24f1d5b682d0cf8398f5 (diff)
BUILD : 1.7.1 (59) BUGS : 10 NOTES : Fixed the second part of bug 10. The mydbgen script should behave much better now.
git-svn-id: svn://svn.anope.org/anope/trunk@59 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@40 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r--Changes1
-rwxr-xr-xbin/mydbgen34
-rw-r--r--version.log7
3 files changed, 26 insertions, 16 deletions
diff --git a/Changes b/Changes
index fb14717fb..ff2798362 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,7 @@
Anope Version SVN
--------------------
Provided by Anope Dev. <dev@anope.org>
+2004/04/17 Fixed table.sql usage on mydbgen script (Bug #10)
2004/04/17 Fixed bug where anope_ns_req was being referenced
2004/04/17 Added SIGUSR2 signal to Rehash Config and Save DBs
2004/04/16 Fixed broken password saves to MySQL (Bug #11)
diff --git a/bin/mydbgen b/bin/mydbgen
index 717e5b29b..5dc9e562a 100755
--- a/bin/mydbgen
+++ b/bin/mydbgen
@@ -86,24 +86,28 @@ while [ -z "$SQLDB" ] ; do
fi
done
+MYSQLDUMP="mysqldump -h$SQLHOST -u$SQLUSER -p$SQLPASS $SQLDB"
MYSQLSHOW="mysqlshow -h$SQLHOST -u$SQLUSER -p$SQLPASS $SQLDB"
MYSQL="mysql -h$SQLHOST -u$SQLUSER -p$SQLPASS $SQLDB"
echo ""
-$MYSQLHOW >/dev/null 2>&1
+$MYSQLSHOW | grep -q $SQLDB
if test "$?" = "1" ; then
- echo "It appears that database does not exist. Or that you don't have the"
- echo "correct credentials to access it. Please verify that you have entered"
- echo "the correct values."
- exit
+ echo -n "Unable to find databse, creating... "
+ mysql -h$SQLHOST -u$SQLUSER -p$SQLPASS -Bs -e "create database $SQLDB" >/dev/null 2>&1
+ if test "$?" = "0" ; then
+ echo "done!"
+ else
+ echo "failed!"
+ FAILED="$FAILED 'database creation'"
+ fi
fi
-
-res="$($MYSQL -Bs -e "show tables like 'anope_os_core'" | wc -l)"
-if test "$res" = "0" ; then
+$MYSQL -Bs -e "show tables like 'anope_os_core'" | grep -q anope_os_core
+if test "$?" = "1" ; then
echo -n "Unable to find Anope schema, creating... "
- mysql -h$SQLHOST -u$SQLUSER -p$SQLPASS $SQLDB < $DBFILE
+ $MYSQL < $DBFILE
if test "$?" = "0" ; then
echo "done!"
else
@@ -112,8 +116,8 @@ if test "$res" = "0" ; then
fi
else
# Introduced on Anope 1.6.0 -> Table anope_info
- res="$($MYSQL -Bs -e "show tables like 'anope_info'" | wc -l)"
- if test "$res" = "0" ; then
+ $MYSQL -Bs -e "show tables like 'anope_info'" | grep -q anope_info
+ if test "$?" = "1" ; then
echo -n "Unable to find Anope info table, creating... "
echo "CREATE TABLE anope_info (version int, date datetime) TYPE=MyISAM" > $TFILE
mysql -h$SQLHOST -u$SQLUSER -p$SQLPASS $SQLDB < $TFILE >/dev/null 2>&1
@@ -132,8 +136,8 @@ else
fi
# Introduced on Anope 1.5.14.5 -> anope_cs_info.memomax
- res="$($MYSQL -Bs -e "describe anope_cs_info memomax" 2> /dev/null | wc -l)"
- if test "$res" = "0" ; then
+ $MYSQL -Bs -e "describe anope_cs_info memomax" 2> /dev/null | grep -q memomax
+ if test "$?" = "1" ; then
echo -n "Unable to find anope_cs_info.memomax, altering... "
echo "ALTER TABLE anope_cs_info ADD memomax smallint unsigned NOT NULL default 0" > $TFILE
mysql -h$SQLHOST -u$SQLUSER -p$SQLPASS $SQLDB < $TFILE >/dev/null 2>&1
@@ -147,8 +151,8 @@ else
fi
# Introduced on Anope 1.5.14.5 -> anope_cs_info.ttb
- res="$($MYSQL -Bs -e "describe anope_cs_info ttb" | wc -l)"
- if test "$res" = "0" ; then
+ $MYSQL -Bs -e "describe anope_cs_info ttb" 2> /dev/null | grep -q ttb
+ if test "$?" = "1" ; then
echo -n "Unable to find anope_cs_info.ttb, altering... "
echo "ALTER TABLE anope_cs_info ADD ttb smallint NOT NULL default 0" > $TFILE
mysql -h$SQLHOST -u$SQLUSER -p$SQLPASS $SQLDB < $TFILE >/dev/null 2>&1
diff --git a/version.log b/version.log
index 3e87ecbee..73c689aba 100644
--- a/version.log
+++ b/version.log
@@ -8,11 +8,16 @@
VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="1"
-VERSION_BUILD="58"
+VERSION_BUILD="59"
VERSION_EXTRA=""
# $Log$
#
+# BUILD : 1.7.1 (59)
+# BUGS : 10
+# NOTES : Fixed the second part of bug 10. The mydbgen script should
+# behave much better now.
+#
# BUILD : 1.7.1 (58)
# BUGS :
# NOTES : anope_ns_req was being referenced should have been anope_ns_request (fixed)