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)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 17 Feb 2017 13:20:56 +0000 (13:20 +0000)
commit4ecc98c37f7d8bcdc89f6d6af2042997fce5e42e
treed8443356762bcff37ce2afc5780de3e9f913b2b7
parent2b9662e0ca87f6344a8edb9093e06c811295df6c
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: Kyle M Hall <kyle@bywatersolutions.com>
debian/scripts/koha-functions.sh