From 872b4719d9d3064284527b235a2a1438d799bae7 Mon Sep 17 00:00:00 2001 From: Frank Sundermeyer Date: Wed, 6 Mar 2024 17:52:21 +0100 Subject: [PATCH] Fix: xml/xmlstarlet was hardcoded in bin/daps --- bin/daps.in | 13 ++++++++----- lib/unpack-locdrop | 7 ------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/bin/daps.in b/bin/daps.in index e931ebd2a..84ff9d6e3 100755 --- a/bin/daps.in +++ b/bin/daps.in @@ -40,10 +40,12 @@ export prefix=@prefix@ # need to be added here!! # - - - - +# check for xmlstarlet binary +for _binary in xmlstarlet xml; do + XMLSTARLET=$(which $_binary 2>/dev/null) + [[ 0 -eq $? ]] && break +done +[[ -z $XMLSTARLET ]] && exit_on_error "Required package \"xmlstarlet\" is not installed" declare -a VARLIST VARLIST=( @@ -158,6 +160,7 @@ VARLIST=( XML_CATALOG_FILES XMLFORMAT_CONFIG_FILE XML_MAIN_CATALOG + XMLSTARLET XML_USER_CATALOGS XSLTPARAM XSLTPROC @@ -1665,7 +1668,7 @@ DOCBOOK_STYLES=${DOCBOOK_STYLES%/} # ---------------------------------------------------------------------------- # Check whether we have an assembly by checking the root element from MAIN # -IS_ASSEMBLY=$(xml sel -t -v "local-name(/*)" $MAIN 2>/dev/null) +IS_ASSEMBLY=$($XMLSTARLET sel -t -v "local-name(/*)" $MAIN 2>/dev/null) # ---------------------------------------------------------------------------- # Now export all variables set by the config file diff --git a/lib/unpack-locdrop b/lib/unpack-locdrop index 1356bb166..e7e1e65e8 100644 --- a/lib/unpack-locdrop +++ b/lib/unpack-locdrop @@ -166,13 +166,6 @@ function unpack-locdrop { # to send them # - # check for xmlstarlet binary - for _binary in xmlstarlet xml; do - XMLSTARLET=$(which $_binary 2>/dev/null) - [[ 0 -eq $? ]] && break - done - [[ -z $XMLSTARLET ]] && exit_on_error "Required package \"xmlstarlet\" is not installed" - # # Get a list of all translated xml files #