Lines 222-237
adjust_paths_dev_install()
Link Here
|
222 |
# corresponding tag in koha-conf.xml |
222 |
# corresponding tag in koha-conf.xml |
223 |
|
223 |
|
224 |
local instancename=$1 |
224 |
local instancename=$1 |
225 |
local dev_install |
225 |
local dev_install=$(run_safe_xmlstarlet $instancename dev_install) |
226 |
|
|
|
227 |
if [ -e /etc/koha/sites/$instancename/koha-conf.xml ]; then |
228 |
dev_install=$(xmlstarlet sel -t -v 'yazgfs/config/dev_install' /etc/koha/sites/$instancename/koha-conf.xml) |
229 |
fi |
230 |
|
226 |
|
231 |
if [ "$dev_install" != "" ]; then |
227 |
if [ "$dev_install" != "" ]; then |
232 |
DEV_INSTALL=1 |
228 |
DEV_INSTALL=1 |
233 |
KOHA_HOME=$dev_install |
229 |
KOHA_HOME=$dev_install |
234 |
PERL5LIB=$dev_install |
230 |
PERL5LIB=$dev_install |
|
|
231 |
else |
232 |
DEV_INSTALL="" |
235 |
fi |
233 |
fi |
236 |
} |
234 |
} |
237 |
|
235 |
|
Lines 244-256
get_instances()
Link Here
|
244 |
get_loglevels() |
242 |
get_loglevels() |
245 |
{ |
243 |
{ |
246 |
local instancename=$1 |
244 |
local instancename=$1 |
247 |
local retval=$(xmlstarlet sel -t -v 'yazgfs/config/zebra_loglevels' /etc/koha/sites/$instancename/koha-conf.xml) |
245 |
local retval=$(run_safe_xmlstarlet $instancename zebra_loglevels) |
248 |
if [ "$retval" != "" ]; then |
246 |
if [ "$retval" != "" ]; then |
249 |
echo "$retval" |
247 |
echo "$retval" |
250 |
else |
248 |
else |
251 |
echo "none,fatal,warn" |
249 |
echo "none,fatal,warn" |
252 |
fi |
250 |
fi |
253 |
|
|
|
254 |
} |
251 |
} |
255 |
|
252 |
|
256 |
get_tmpdir() |
253 |
get_tmpdir() |
Lines 272-274
get_tmpdir()
Link Here
|
272 |
fi |
269 |
fi |
273 |
echo $(dirname $retval) |
270 |
echo $(dirname $retval) |
274 |
} |
271 |
} |
275 |
- |
272 |
|
|
|
273 |
run_safe_xmlstarlet() |
274 |
{ |
275 |
# When a bash script sets -e (errexit), calling xmlstarlet on an |
276 |
# unexisting key would halt the script. This is resolved by calling |
277 |
# this function in a subshell. It will always returns true, while not |
278 |
# affecting the exec env of the caller. (Otherwise, errexit is cleared.) |
279 |
local instancename=$1 |
280 |
local myexpr=$2 |
281 |
set +e; # stay on the safe side |
282 |
echo $(xmlstarlet sel -t -v "yazgfs/config/$myexpr" /etc/koha/sites/$instancename/koha-conf.xml) |
283 |
return 0 |
284 |
} |