Summary: | koha-create expects the file passed by $DEFAULTSQL to be in gzip format | ||
---|---|---|---|
Product: | Koha | Reporter: | Andreas Roussos <arouss1980> |
Component: | Installation and upgrade (command-line installer) | Assignee: | Andreas Roussos <arouss1980> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | major | ||
Priority: | P3 | CC: | fridolin.somers, martin.renvoize, nick |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: |
Add support to koha-create to allow it to accept both compressed and uncompressed files for DEFAULTSQL
|
Version(s) released in: | |
Attachments: |
Bug 21440: koha-create expects the file passed by $DEFAULTSQL to be in gzip format
Bug 21440: koha-create expects the file passed by $DEFAULTSQL to be in gzip format Bug 21440: koha-create expects the file passed by $DEFAULTSQL to be in gzip format |
Description
Andreas Roussos
2018-09-27 16:02:10 UTC
Created attachment 79541 [details] [review] 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 Created attachment 80216 [details] [review] 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> Nice little fix that works well, signing off. Created attachment 80235 [details] [review] 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> Awesome work all! Pushed to master for 18.11 Pushed to 18.05.x for 18.05.05 Pushed to 17.11.x for 17.11.11 |