Bugzilla – Attachment 80235 Details for
Bug 21440
koha-create expects the file passed by $DEFAULTSQL to be in gzip format
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21440: koha-create expects the file passed by $DEFAULTSQL to be in gzip format
Bug-21440-koha-create-expects-the-file-passed-by-D.patch (text/plain), 2.22 KB, created by
Chris Cormack
on 2018-10-08 20:31:42 UTC
(
hide
)
Description:
Bug 21440: koha-create expects the file passed by $DEFAULTSQL to be in gzip format
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2018-10-08 20:31:42 UTC
Size:
2.22 KB
patch
obsolete
>From c7f8dd1a5443279f531fc5281391e39b47804370 Mon Sep 17 00:00:00 2001 >From: Andreas Roussos <arouss1980@gmail.com> >Date: Thu, 27 Sep 2018 19:05:48 +0300 >Subject: [PATCH] Bug 21440: koha-create expects the file passed by $DEFAULTSQL > to be in gzip format > >koha-create contains a call to `zcat` which fails if the file passed >as an argument is not in gzip format. > >This patch fixes the issue by adding the -f flag to the zcat call in >koha-create, as per the top-voted answers in the following SE URLs: >https://unix.stackexchange.com/a/77309 >https://unix.stackexchange.com/a/131944 > >Test plan: >1) in /etc/koha/koha-sites.conf, set the DEFAULTSQL variable to point > to an _uncompressed_ SQL database dump >2) run `koha-create --create-db instance` and notice how it fails with: > gzip: /path/to/dump.sql: not in gzip format >3) apply the patch >4) notice the extra line of information "The SQL file can be optionally > compressed with gzip" in koha-sites.conf >5) run the `koha-create` command again, this time it should work >6) repeat with DEFAULTSQL pointing to a gzip'd dump, it should work too > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> >--- > debian/scripts/koha-create | 2 +- > debian/templates/koha-sites.conf | 1 + > 2 files changed, 2 insertions(+), 1 deletion(-) > >diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create >index 74c8cf92e6..afe1f55edc 100755 >--- a/debian/scripts/koha-create >+++ b/debian/scripts/koha-create >@@ -684,7 +684,7 @@ then > if [ -e "$DEFAULTSQL" ] > then > # Populate the database with default content. >- zcat "$DEFAULTSQL" | >+ zcat -f "$DEFAULTSQL" | > sed "s/__KOHASITE__/koha_$name/g" | > mysql --host="$mysqlhost" --user="$mysqluser" --password="$mysqlpwd" "$mysqldb" > >diff --git a/debian/templates/koha-sites.conf b/debian/templates/koha-sites.conf >index 53a1250220..3be4c55d73 100644 >--- a/debian/templates/koha-sites.conf >+++ b/debian/templates/koha-sites.conf >@@ -17,6 +17,7 @@ OPACSUFFIX="" > # > # DEFAULTSQL: filename > # Specify an SQL file with default data to load during instance creation >+# The SQL file can be optionally compressed with gzip > # default: (empty) > DEFAULTSQL="" > >-- >2.19.1
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 21440
:
79541
|
80216
| 80235