Bugzilla – Attachment 79541 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.10 KB, created by
Andreas Roussos
on 2018-09-27 16:08:17 UTC
(
hide
)
Description:
Bug 21440: koha-create expects the file passed by $DEFAULTSQL to be in gzip format
Filename:
MIME Type:
Creator:
Andreas Roussos
Created:
2018-09-27 16:08:17 UTC
Size:
2.10 KB
patch
obsolete
>From 3b3c021d5f3020d6b4dfd266dded568954d03ed2 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 >--- > 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 874c7d1c79..835740d15d 100755 >--- a/debian/scripts/koha-create >+++ b/debian/scripts/koha-create >@@ -686,7 +686,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 8cbd6c1e20..a1d5cf908b 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.11.0
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