Skip to content

Commit

Permalink
Fix: xml/xmlstarlet was hardcoded in bin/daps
Browse files Browse the repository at this point in the history
  • Loading branch information
fsundermeyer committed Mar 8, 2024
1 parent 8ba0243 commit c8956e8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 27 deletions.
15 changes: 9 additions & 6 deletions bin/daps.in
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ export prefix=@prefix@
# need to be added here!!
#






declare -a VARLIST
VARLIST=(
ADOC_ATTRIBUTES
Expand Down Expand Up @@ -158,6 +153,7 @@ VARLIST=(
XML_CATALOG_FILES
XMLFORMAT_CONFIG_FILE
XML_MAIN_CATALOG
XMLSTARLET
XML_USER_CATALOGS
XSLTPARAM
XSLTPROC
Expand Down Expand Up @@ -195,6 +191,13 @@ UNSETLIST=(
)
unset "${UNSETLIST[@]}"

# 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"

# PATHLIST contains all variables holding a path. Relative paths need to be
# made absolute and we need this list in order to know which variables hold
# path information
Expand Down Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions lib/unpack-locdrop
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down
14 changes: 0 additions & 14 deletions make/common_variables.mk
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,6 @@ define \n

endef

#--------------------------------------------------
# xmlstarlet
#
# Prior to openSUSE 13.2 the suse xmlstarlet package had /usr/bin/xml, while
# other distributions used /usr/bin/xmlstarlet

HAVE_XMLSTARLET := $(shell command -v xmlstarlet 2>/dev/null)

ifndef HAVE_XMLSTARLET
XMLSTARLET := /usr/bin/xml
else
XMLSTARLET := /usr/bin/xmlstarlet
endif

#--------------------------------------------------
# VERBOSITY
#
Expand Down

0 comments on commit c8956e8

Please sign in to comment.