Bug 16749: Adjust xmlstarlet calls in koha-functions
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Fri, 10 Feb 2017 08:37:13 +0000 (09:37 +0100)
committerKatrin Fischer <katrin.fischer.83@web.de>
Tue, 16 May 2017 05:55:47 +0000 (07:55 +0200)
commit2516012d2688037e2d122001f78b105e102d4000
tree8af5671041bd527151e83482d85275e7e832561c
parentc15cf2a47cc753c526abfa54b6e9ace439f71d63
Bug 16749: Adjust xmlstarlet calls in koha-functions

In various scripts we use xmlstarlet to extract values from koha-conf.
If we call xmlstarlet on non-existing entries in koha-conf, this may
however result in silently failing scripts (when set -e is in effect).

A function run_safe_xmlstarlet is added for situations where the entry
might not exist. It will not halt execution.

This patch only adjusts koha-functions.sh and modifies the xmlstarlet calls
for dev_install and zebra_loglevels.

Note: The function does not need to check file existence. If the file does
not exist, xmlstarlet warns about it; the function returns empty string,
but does not set an error exit status.

Test plan: See second patch ("koha-plack adjustments").

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Tested in a package installation of master+16749

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
debian/scripts/koha-functions.sh