Bugzilla – Attachment 58540 Details for
Bug 17265
Make koha-create and koha-dump-defaults less greedy
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17265 - Make koha-create-defaults less greedy
Bug-17265---Make-koha-create-defaults-less-greedy.patch (text/plain), 2.56 KB, created by
Kyle M Hall (khall)
on 2016-12-30 18:02:48 UTC
(
hide
)
Description:
Bug 17265 - Make koha-create-defaults less greedy
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2016-12-30 18:02:48 UTC
Size:
2.56 KB
patch
obsolete
>From 44f28c7a9739edcfc8127862fc29a40b24533a4f Mon Sep 17 00:00:00 2001 >From: Magnus Enger <magnus@libriotech.no> >Date: Thu, 8 Sep 2016 14:13:46 +0200 >Subject: [PATCH] Bug 17265 - Make koha-create-defaults less greedy >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >koha-create-defaults substitutes the instance name with the placeholder >__KOHASITE__ in the SQL file that it creates. If the instance name is >something common, like "data", this means that way too many substitutions >will be made, and when koha-create uses the SQL file as a template, broken >data can be the result. > >The solution in this patch was suggested by drojf on IRC. > >To test: >- Create an instance called "data" >- Run "sudo koha-dump-defaults data > test.sql" >- Take a look at test.sql and verify there are way too many occurences > of __KOHASITE__, like "-- Dumping __KOHASITE__ for table `accountlines`" >- Apply the patch >- Copy the resulting koha-create and koha-dump-defaults to somewhere > running off the packages >- Run "sudo koha-dump-defaults data > test.sql" again and verify there > are only 4 occurrences of __KOHASITE__, in places that make sense >- Create an instance with something like: > $ gzip test.sql > $Â sudo koha-create --create-db --defaultsql test.sql.gz test17265 >- Verify that you have a working Koha install > >Signed-off-by: Andreas Roussos <arouss1980@gmail.com> >Works as expected. > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > debian/scripts/koha-create | 2 +- > debian/scripts/koha-dump-defaults | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > >diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create >index 2636675..b21e472 100755 >--- a/debian/scripts/koha-create >+++ b/debian/scripts/koha-create >@@ -745,7 +745,7 @@ then > then > # Populate the database with default content. > zcat "$DEFAULTSQL" | >- sed "s/__KOHASITE__/$name/g" | >+ sed "s/__KOHASITE__/koha_$name/g" | > mysql --host="$mysqlhost" --user="$mysqluser" --password="$mysqlpwd" "$mysqldb" > > >diff --git a/debian/scripts/koha-dump-defaults b/debian/scripts/koha-dump-defaults >index fb5e988..21b1200 100755 >--- a/debian/scripts/koha-dump-defaults >+++ b/debian/scripts/koha-dump-defaults >@@ -33,4 +33,4 @@ mysqluser="$( xmlstarlet sel -t -v 'yazgfs/config/user' $kohaconfig )" > mysqlpass="$( xmlstarlet sel -t -v 'yazgfs/config/pass' $kohaconfig )" > mysqldump --databases --host="$mysqlhost" --user="$mysqluser" \ > --password="$mysqlpass" "$mysqldb" | >- sed "s/$name/__KOHASITE__/g" >+ sed "s/koha_$name/__KOHASITE__/g" >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17265
:
55338
|
55458
| 58540