]> git.koha-community.org Git - koha.git/commit
Bug 21440: koha-create expects the file passed by $DEFAULTSQL to be in gzip format
authorAndreas Roussos <arouss1980@gmail.com>
Thu, 27 Sep 2018 16:05:48 +0000 (19:05 +0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 24 Oct 2018 09:06:46 +0000 (11:06 +0200)
commitf7ad8af0f77688a6eaf8075a6ba56d77e455263e
tree0fa4eb1fd211a22b6f88aea20d6fed8a7b32435c
parentbb0d85b6c1ddd22799a73a40efac95bc574906e7
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>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit f12dabe6ccd9400a4ae744a5d74bbddcd9f7ac95)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 89f0452ba17c54045656ee2654a162fd4a96a744)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
debian/scripts/koha-create
debian/templates/koha-sites.conf