[Koha-patches] [PATCH] Bug 6517 - koha-create wants "use database" in DEFAULTSQL

Magnus Enger magnus at enger.priv.no
Wed Jun 29 23:31:38 CEST 2011


This patch makes sure that pointing DEFAULTSQL in /etc/koha/koha-sites.conf
to any (gzip'ed) file produced by mysqldump works, by adding the name of the
database to the end of the call to mysql, when the specified SQL file is
loaded. Files produced with koha-dump-defaults should still work too.

To test:
- Apply the patch
- Create an SQL file from an existing installation with mysqldump
- gzip the SQL file
- point DEFAULTSQL to the file in /etc/koha/koha-sites.conf
- create a new site with koha-create --create-db
---
 debian/scripts/koha-create |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create
index e3c73fc..bb4dbef 100755
--- a/debian/scripts/koha-create
+++ b/debian/scripts/koha-create
@@ -189,7 +189,7 @@ then
         # Populate the database with default content.
         zcat "$DEFAULTSQL" |
         sed "s/__KOHASITE__/$name/g" |
-        mysql --host="$mysqlhost" --user="$mysqluser" --password="$mysqlpwd"
+        mysql --host="$mysqlhost" --user="$mysqluser" --password="$mysqlpwd" $mysqldb
 
 
         # Change the default user's password.
-- 
1.7.4.1



More information about the Koha-patches mailing list