diff --git a/ChangeLog b/ChangeLog index 5d40955eb..b420484b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,43 +1,75 @@ +------------------------------------------------------------------- +Mon Dec 07 14:43:47 UTC 2015 - fsundermeyer@opensuse.org + +Stable release DAPS 2.1.5: + +* New Features: + - parameters for text generation can be set in the config files + via TXT_PARAMS or via --param/--stringparam on the command line + - a change introduced in 2.0 made using the original DocBook + stylesheets for text generation the default. Since this behavior + is confusing and unexpected, it is reverted with this change: + * the stylesheets configured via STYLEROOT or --styleroot are + used by default for text generation + * to ignore _any_ STYLEROOT definitions, set + TXT_IGNORE_STYLEROOT="yes" in the config files or use + --ignore-styleroot on the command line + (daps -d text --ignore-styleroot) + +* Bugfixes: + - Fix for issue #294: xmlcatalog returns file: rather than + file:// on Debian Jessie and openSUSE Tumbleweed and + caused DAPS to fail with DB5 sources + +* Misc + - added basic debugging output to test suite (--debug) + ------------------------------------------------------------------- Tue Dec 02 13:01:00 UTC 2015 - toms@opensuse.org Stable release DAPS 2.1.4: -Find issues in our GitHub tracker at https://github.com/openSUSE/daps/issues/NUMBER +Find issues in our GitHub tracker at +https://github.com/openSUSE/daps/issues/NUMBER * Bugfixes: - Target text shows remarks (issue #293) - DAPS checklink doesn't work (issue #296) - - ASPELL_EXTRA_DICT from ~/.config/daps/dapsrc is ignored (issue #297) + - ASPELL_EXTRA_DICT from ~/.config/daps/dapsrc is ignored + (issue #297) - DAPS package includes SUSE wordlist (issue #298) - - Parameter passed with --param is ignored with subcommand "text" (issue #299) - - Target locdrop does not generate graphics-setfiles-$(DOCNAME)$(LANGSTRING).tar.bz2 - (issue #302) + - Parameter passed with --param is ignored with subcommand "text" + (issue #299) + - Target locdrop does not generate + graphics-setfiles-$(DOCNAME)$(LANGSTRING).tar.bz2 (issue #302) - Translation check for locdrop (issue #306) - Add --optipng to unpack-locdrop (issue #307) - Add --xmlonly / --imgonly switches to list-srcfiles (issue #310) - bigfile creates unresolved xrefs for DocBook5 (issue #314) - Improve DocBook5 -> DocBook4 -> Novdoc Stylesheets (issue #311) - Enhancements in user guide, thanks to Martin Koeditz (issue #315) - - FO contains wrong image paths when XML contains no profiling PI (issue #316) - - DB-4-to-5 migration: missing book titles/productnames/productnumbers - (issue #319) + - FO contains wrong image paths when XML contains no profiling PI + (issue #316) + - DB-4-to-5 migration: missing book + titles/productnames/productnumbers (issue #319) * New Features: - - Option --schema lets you specify an URN to a DocBook 5 schema that is to - be used for validation. Will be ignored when validating Docbbok4 documents. - - DOCBOOK5_STYLE_URI, DOCBOOK5_STYLE_URI, and DOCBOOK4_STYLE_URI may now - also point to a local file. If the URN begins with the prefix "file://", - it will not be resolved via xmlcatalog, but rather taken as is (minus - "file://"). + - Option --schema lets you specify an URN to a DocBook 5 schema that + is to be used for validation. Will be ignored when validating + Docbbok4 documents. + - DOCBOOK5_STYLE_URI, DOCBOOK5_STYLE_URI, and DOCBOOK4_STYLE_URI + may now also point to a local file. If the URN begins with the + prefix "file://", it will not be resolved via xmlcatalog, but + rather taken as is (minus "file://"). - Add conversion options to online-docs: . --db5todb4: converts DocBook 5 sources to a DocBook 4 bigfile - . --db5todb4nh: converts DocBook 5 sources to a DocBook 4 bigfile without - a DOCTYPE declaration + . --db5todb4nh: converts DocBook 5 sources to a DocBook 4 bigfile + without a DOCTYPE declaration . --dbtonovdoc: converts DocBook 4/5 to Novdoc * Misc: - - Do not set -nocs, hurts us when building Arabic (related: issue #108) + - Do not set -nocs, hurts us when building Arabic + (related: issue #108) - Avoid adding version attribute on all elements (commit 3a273d5) diff --git a/bin/daps.in b/bin/daps.in index 9146357b3..070acaec8 100755 --- a/bin/daps.in +++ b/bin/daps.in @@ -144,7 +144,8 @@ VARLIST=( STYLEDEVEL STYLEROOT TARGET - TXT_USE_DBSTYLES + TXT_IGNORE_STYLEROOT + TXT_PARAMS WH_SEARCH VALID_ROOTELEMENTS VERBOSITY @@ -399,8 +400,8 @@ HELP_SUBCOMMAND+=("spellcheck=Spellchecks the file specified with --file or the SUBCOMMANDS+=("stylecheck=stylecheck") HELP_SUBCOMMAND+=("stylecheck=Performs a style check on the given DC-file or rootid.") -SUBCOMMANDS+=("text=build_generic") -HELP_SUBCOMMAND+=("text=Build an ASCII text document the from the XML sources.") +SUBCOMMANDS+=("text=build_text") +HELP_SUBCOMMAND+=("text=Build an ASCII text document the from the XML sources. Text output is\ngenerated by creating a single file HTML page parsing the result with w3m.") SUBCOMMANDS+=("text-name=show_names") HELP_SUBCOMMAND+=("text-name=Print the file name that would result when building an ASCII text document.") @@ -1583,7 +1584,7 @@ DOCBOOK_VERSION=$($XSLTPROC --stylesheet "${DAPSROOT}/daps-xslt/common/get-docbo if [[ 5 = "$DOCBOOK_VERSION" ]]; then # resolve stylesheet URN # - if [[ ${DOCBOOK5_STYLE_URI:0:7} = file:// ]]; then + if [[ ${DOCBOOK5_STYLE_URI:0:5} = file: ]]; then DOCBOOK_STYLES="$DOCBOOK5_STYLE_URI" else DOCBOOK_STYLES=$(xmlcatalog "$XML_MAIN_CATALOG" \ @@ -1592,16 +1593,18 @@ if [[ 5 = "$DOCBOOK_VERSION" ]]; then fi # also get the RNG scheme location # - if [[ ${DOCBOOK5_RNG_URI:0:7} = file:// ]]; then + if [[ ${DOCBOOK5_RNG_URI:0:5} = file: ]]; then DOCBOOK5_RNG="$DOCBOOK5_RNG_URI" else DOCBOOK5_RNG=$(xmlcatalog "$XML_MAIN_CATALOG" \ "$DOCBOOK5_RNG_URI" 2>/dev/null) || \ exit_on_error "Could not determine the DocBook 5 schema location by resolving \"$DOCBOOK5_RNG_URI\" via xmlcatalog" fi - # remove file:// prefix + # remove file:// or file: (Debian, Tumbleweed) prefix + # Is there a better way to do this with shell built-ins? # - DOCBOOK5_RNG=${DOCBOOK5_RNG##*file://} + DOCBOOK5_RNG=${DOCBOOK5_RNG##*file:} + DOCBOOK5_RNG=${DOCBOOK5_RNG#*//} # # check if resulting path is valid # @@ -1618,7 +1621,7 @@ if [[ 5 = "$DOCBOOK_VERSION" ]]; then elif [[ 4 = "$DOCBOOK_VERSION" ]]; then # resolve stylesheet URN # - if [[ ${DOCBOOK4_STYLE_URI:0:7} = file:// ]]; then + if [[ ${DOCBOOK4_STYLE_URI:0:5} = file: ]]; then DOCBOOK_STYLES="$DOCBOOK4_STYLE_URI" else DOCBOOK_STYLES=$(xmlcatalog "$XML_MAIN_CATALOG" \ @@ -1628,18 +1631,23 @@ elif [[ 4 = "$DOCBOOK_VERSION" ]]; then else exit_on_error "Fatal: Could not determine the DocBook version from $MAIN. Looks like $MAIN is not a DocBook 4/5 document." fi -# -# remove the file:// string from the styles + +# remove the file:// or file: (Debian, Tumbleweed) string from the styles # use ##*file:// rather than #file:// because sometimes xmlcatalog also outputs # warnings to stdout which we would like to ignore. Fortunately the file:// url # is always the last string # -DOCBOOK_STYLES=${DOCBOOK_STYLES##*file://} +# Is there a better way to do this with shell built-ins? +# +DOCBOOK_STYLES=${DOCBOOK_STYLES##*file:} +DOCBOOK_STYLES=${DOCBOOK_STYLES#*//} DOCBOOK_STYLES=${DOCBOOK_STYLES%/} + # # Check resulting path # [[ -d "$DOCBOOK_STYLES" ]] || exit_on_error "DOCBOOK4_STYLE_URI or DOCBOOK5_STYLE_URI points to a non-existing directory \"$DOCBOOK_STYLES\"." + # ...and export export DOCBOOK_STYLES DOCBOOK5_RNG DOCBOOK_VERSION diff --git a/configure.ac b/configure.ac index 1ff9ddb91..5fe5cf41d 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ dnl m4_define(daps_version_major, 2) m4_define(daps_version_minor, 1) -m4_define(daps_version_micro, [4]) +m4_define(daps_version_micro, [5]) # API version m4_define([daps_api_version],[daps_version_major]) diff --git a/etc/config.in b/etc/config.in index 05fbc981b..14561dc62 100644 --- a/etc/config.in +++ b/etc/config.in @@ -178,6 +178,12 @@ DIA_OPTIONS="-t cairo-svg" # There should be no need to change this entry # Note: # URI _must_ end with a "/", otherwise it will not be resolved on Ubuntu +# WARNING: +# This value needs to point to the original DocBook stylesheets. It will +# ensure that there always is a fallback in case the stylesheets specified +# elsewhere do not provide the requested output format. These styles are +# also used to generate text output. Only change if the default value +# cannot be resolved by xmlcatalog. # DOCBOOK4_STYLE_URI="http://docbook.sourceforge.net/release/xsl/current/" @@ -192,6 +198,13 @@ DOCBOOK4_STYLE_URI="http://docbook.sourceforge.net/release/xsl/current/" # Note: # URI _must_ end with a "/", otherwise it will not be resolved on Ubuntu # +# WARNING: +# This value needs to point to the original DocBook stylesheets. It will +# ensure that there always is a fallback in case the stylesheets specified +# elsewhere do not provide the requested output format. These styles are +# also used to generate text output. Only change if the default value +# cannot be resolved by xmlcatalog. +# DOCBOOK5_STYLE_URI="http://docbook.sourceforge.net/release/xsl-ns/current/" ## Key: DOCBOOK5_RNG_URI @@ -672,24 +685,53 @@ STYLEDEVEL="" # directory here. The DocBook stylesheets will be used as a fallback in case # styles are not defined for all output formats. # -# See also FALLBACK_STYLEROOT +# See also: FALLBACK_STYLEROOT # STYLEROOT="" -## Key: TXT_USE_DBSTYLES -## ------------------- -## Description: Always use original DocBook stylesheets for text output? +## Key: TXT_IGNORE_STYLEROOT +## --------------------------------- +## Description: Ignore styleroot and rather use the original DocBook +## stylesheets for text output? ## Type: yesno -## Default: "yes" +## Default: "no" # # Text output is generated by creating a single file HTML page parsing # the result with w3m. This ensures that e.g. tables are properly -# displayed in the .txt file. Default is to use the original DocBook -# stylesheets to generate the HTML that is used to create the text files. If -# you prefer to use your own stylesheets (STYLEROOT/xhtml/docsbook.xsl) set -# this variable to "no". +# displayed in the .txt file. Default is to use the stylesheets provided +# via STYLEROOT or --styleroot to build the HTML. Set this option to +# "yes" to ignore the STYLEROOT and to use the original DocBook +# stylesheets instead. +# +# NOTE: This will aslo work if STYLEROOT points to the original +# DocBook stylesheets. +# +# See also: TXT_PARAMS # -TXT_USE_DBSTYLES="yes" +TXT_IGNORE_STYLEROOT="no" + + +## Key: TXT_PARAMS +## ------------------- +## Description: XSL paramters for text file generation +## Type: string +## Default: '--param="generate.permalinks=0" --param="section.autolabel=1" --param="section.label.includes.component.label=2"' +# +# Text output is generated by creating a single file HTML page parsing +# the result with w3m. This ensures that e.g. tables are properly +# displayed in the .txt file. This configuration option can be used to set +# custom XSL parameters - the HTML stylesheets are not necessarily +# configured in a way that is suitable for text output. +# The default value for TXT_PARAMS turns on labelling and makes sure +# admonitions have a text label. Other parameters turn off stuff that is +# of no use in text output. +# For a reference of all HTML parameters refer to +# http://docbook.sourceforge.net/release/xsl/current/doc/html/index.html +# +# NOTE: Make sure to use single quotes to quote the complete string, since it +# contains double quotes +# +TXT_PARAMS='--param="admon.textlabel=1" --param="section.autolabel=1" --param="section.label.includes.component.label=2" --param="optimize.plain.text=1"' ## Key: VALID_ROOTELEMENTS ## -------------------- diff --git a/lib/daps_functions b/lib/daps_functions index 0a44d1473..ad43d7e0d 100644 --- a/lib/daps_functions +++ b/lib/daps_functions @@ -136,6 +136,10 @@ function parse_args { P_HTML5=1 shift ;; + --ignore-styleroot) + P_TXT_IGNORE_STYLEROOT=1 + shift + ;; --imgonly) P_LIST_IMG_ONLY=1 shift @@ -527,21 +531,25 @@ function call_make { DOCBOOK5_RNG: $DOCBOOK5_RNG EOF - if [[ -n "$STYLEDEVEL" ]]; then - echo " STYLEROOT: $STYLEDEVEL" + if [[ $SUB_CMD =~ text && "yes" == "$TXT_IGNORE_STYLEROOT" || 1 = "$P_TXT_IGNORE_STYLEROOT" ]]; then + echo " STYLEROOT: $DOCBOOK_STYLES" else - if [[ -n "$STYLEROOT" ]]; then - echo " STYLEROOT: $STYLEROOT" + if [[ -n "$STYLEDEVEL" ]]; then + echo " STYLEROOT: $STYLEDEVEL" else - echo " STYLEROOT: $DOCBOOK_STYLES" + if [[ -n "$STYLEROOT" ]]; then + echo " STYLEROOT: $STYLEROOT" + else + echo " STYLEROOT: $DOCBOOK_STYLES" + fi fi - fi - if [[ -n "$FALLBACK_STYLEROOT" ]]; then - echo "FALLBACK_STYLEROOT: $FALLBACK_STYLEROOT" - else - # no fallback if STYLEROOT is not set - if [[ -n "$STYLEROOT" ]]; then - echo "FALLBACK_STYLEROOT: $DOCBOOK_STYLES" + if [[ -n "$FALLBACK_STYLEROOT" ]]; then + echo "FALLBACK_STYLEROOT: $FALLBACK_STYLEROOT" + else + # no fallback if STYLEROOT is not set + if [[ -n "$STYLEROOT" ]]; then + echo "FALLBACK_STYLEROOT: $DOCBOOK_STYLES" + fi fi fi @@ -926,7 +934,46 @@ function build_man { call_make "$SUB_CMD" "$@" } +########################################################################### +# +# BUILD text files +# +# Subcommands: text only +# +########################################################################### +function build_text { + local SHORT_OPTS LONG_OPTS SUB_CMD + SUB_CMD=$1 + shift + + SHORT_OPTS="h" + LONG_OPTS="ignore-styleroot,help,name:,param:,rootid:,stringparam:" + parse_args "$SHORT_OPTS" "$LONG_OPTS" "$SUB_CMD" "$@" + eval set -- "$P_REMAIN_ARGS" + + #------ Computing the values returned from the parser ----- + if [[ 1 = "$P_HELP" ]]; then + help_scmd_head "$SUB_CMD" "$HELP_SUBCMD" + help_ignore-styleroot + help_help + help_name + help_param + help_rootid + help_stringparam + echo + exit 0 + fi + + [[ 1 = "$P_TXT_IGNORE_STYLEROOT" ]] && export TXT_IGNORE_STYLEROOT="yes" + [[ -n "$P_NAME" ]] && export PDFNAME="$P_NAME" BOOK="$P_NAME" + [[ -n "$P_ROOTID" ]] && export ROOTID="$P_ROOTID" + [[ -n "$P_STRINGPARAMS" ]] && export STRINGPARAMS="$P_STRINGPARAMS" + [[ -n "$P_PARAMS" ]] && export PARAMS="$P_PARAMS" + [[ -n "$P_XSLTPARAM" ]] && export XSLTPARAM="$XSLTPARAM $P_XSLTPARAM" + + call_make "$SUB_CMD" "$@" +} ########################################################################### # @@ -1008,7 +1055,7 @@ function build_locdrop { if [[ -f "$P_DEF_FILE" ]]; then export DEF_FILE="$P_DEF_FILE" elif [[ -z "$P_DEF_FILE" ]]; then - [[ 0 != $VERBOSITY ]] && ccecho "warn" "Warning: No DEF file was specified" + [[ 0 != "$VERBOSITY" ]] && ccecho "warn" "Warning: No DEF file was specified" else exit_on_error "Cannot find DEF file \"$P_DEF_FILE\"" fi @@ -1158,7 +1205,7 @@ function package-src { exit_on_error "Cannot find DEF file \"$P_DEF_FILE\"" fi else - [[ 0 != $VERBOSITY ]] && ccecho "warn" "Warning: No DEF file was specified" + [[ 0 != "$VERBOSITY" ]] && ccecho "warn" "Warning: No DEF file was specified" fi if [[ -n "$P_SETDATE" ]]; then @@ -2162,11 +2209,9 @@ function showenv { # first line of help # function help_scmd_head { - cat <&2 - rm -rf "${_DOC_DIR}/build" "$_TEMPDIR" + if [[ 1 -ne $_DEBUG ]]; then + rm -rf "${_DOC_DIR}/build" + fi + rm -rf "$_TEMPDIR" [[ -f $_MULTISRC_IMAGE ]] && rm -f $_MULTISRC_IMAGE exit 1; } @@ -121,7 +124,7 @@ done # SVN dependencies #_ARGS=$(getopt -o h -l all,builddir,epub,filelists,help,html,images,locdrop,online-docs,package-html,package-pdf,package-src,pdf,profiling,script,text,xsltprocessors: -n "$_ME" -- "$@") -_ARGS=$(getopt -o h -l all,builddir,epub,filelists,help,html,images,online-docs,package-html,package-pdf,package-src,pdf,profiling,script,text,xsltprocessors: -n "$_ME" -- "$@") +_ARGS=$(getopt -o h -l all,builddir,debug,epub,filelists,help,html,images,online-docs,package-html,package-pdf,package-src,pdf,profiling,script,text,xsltprocessors: -n "$_ME" -- "$@") [[ 0 -ne $? ]] && exit_on_error "Argument parser error" @@ -134,83 +137,88 @@ GETOPT_RETURN_CODE=$? while true ; do case "$1" in - --all) -# _TESTS=( "${_TESTS[@]}" "lib/001_script" "lib/005_profiling" "lib/007_images" "lib/009_builddir" "lib/020_pdf" "lib/022_html" "lib/023_text" "lib/025_epub" "lib/030_package-src" "lib/033_locdrop" "lib/035_online-docs" "lib/036_package-html" "lib/037_package-pdf" ) - _TESTS=( "${_TESTS[@]}" "lib/001_script" "lib/005_profiling" "lib/007_images" "lib/009_builddir" "lib/020_pdf" "lib/022_html" "lib/023_text" "lib/025_epub" "lib/030_package-src" "lib/035_online-docs" "lib/036_package-html" "lib/037_package-pdf" ) - shift - ;; - --builddir) - _TESTS=( "${_TESTS[@]}" "lib/009_builddir" ) - shift - ;; - --epub) - _TESTS=( "${_TESTS[@]}" "lib/025_epub" ) - shift - ;; - --filelists) - _TESTS=( "${_TESTS[@]}" "lib/010_filelists" ) - shift - ;; - -h,--help) - usage - rm -rf "$_TEMPDIR" - exit 0 - ;; - --html) - _TESTS=( "${_TESTS[@]}" "lib/022_html" ) - shift - ;; - --images) - _TESTS=( "${_TESTS[@]}" "lib/007_images" ) - shift - ;; - --locdrop) - _TESTS=( "${_TESTS[@]}" "lib/033_locdrop" ) - shift - ;; - --online-docs) - _TESTS=( "${_TESTS[@]}" "lib/035_online-docs" ) - shift - ;; - --package-html) - _TESTS=( "${_TESTS[@]}" "lib/022_html" "lib/036_package-html" ) - shift - ;; - --package-pdf) - _TESTS=( "${_TESTS[@]}" "lib/020_pdf" "lib/037_package-pdf" ) - shift - ;; - --package-src) - _TESTS=( "${_TESTS[@]}" "lib/030_package-src" ) - shift - ;; - --pdf) - _TESTS=( "${_TESTS[@]}" "lib/020_pdf" ) - shift - ;; - --profiling) - _TESTS=( "${_TESTS[@]}" "lib/005_profiling" ) - shift - ;; - --script) - _TESTS=( "${_TESTS[@]}" "lib/001_script" ) - shift - ;; - --text) - _TESTS=( "${_TESTS[@]}" "lib/023_text" ) - shift - ;; - --xsltprocessors) - _XSLTPROCS=( $2 ) - shift 2 - ;; + --all) +# _TESTS=( "${_TESTS[@]}" "lib/001_script" "lib/005_profiling" "lib/007_images" "lib/009_builddir" "lib/020_pdf" "lib/022_html" "lib/023_text" "lib/025_epub" "lib/030_package-src" "lib/033_locdrop" "lib/035_online-docs" "lib/036_package-html" "lib/037_package-pdf" ) + _TESTS=( "${_TESTS[@]}" "lib/001_script" "lib/005_profiling" "lib/007_images" "lib/009_builddir" "lib/020_pdf" "lib/022_html" "lib/023_text" "lib/025_epub" "lib/030_package-src" "lib/035_online-docs" "lib/036_package-html" "lib/037_package-pdf" ) + shift + ;; + --builddir) + _TESTS=( "${_TESTS[@]}" "lib/009_builddir" ) + shift + ;; + --debug) + _DEBUG=1 + _DAPSCMD="$_DAPSCMD --debug" + shift + ;; + --epub) + _TESTS=( "${_TESTS[@]}" "lib/025_epub" ) + shift + ;; + --filelists) + _TESTS=( "${_TESTS[@]}" "lib/010_filelists" ) + shift + ;; + -h,--help) + usage + rm -rf "$_TEMPDIR" + exit 0 + ;; + --html) + _TESTS=( "${_TESTS[@]}" "lib/022_html" ) + shift + ;; + --images) + _TESTS=( "${_TESTS[@]}" "lib/007_images" ) + shift + ;; + --locdrop) + _TESTS=( "${_TESTS[@]}" "lib/033_locdrop" ) + shift + ;; + --online-docs) + _TESTS=( "${_TESTS[@]}" "lib/035_online-docs" ) + shift + ;; + --package-html) + _TESTS=( "${_TESTS[@]}" "lib/022_html" "lib/036_package-html" ) + shift + ;; + --package-pdf) + _TESTS=( "${_TESTS[@]}" "lib/020_pdf" "lib/037_package-pdf" ) + shift + ;; + --package-src) + _TESTS=( "${_TESTS[@]}" "lib/030_package-src" ) + shift + ;; + --pdf) + _TESTS=( "${_TESTS[@]}" "lib/020_pdf" ) + shift + ;; + --profiling) + _TESTS=( "${_TESTS[@]}" "lib/005_profiling" ) + shift + ;; + --script) + _TESTS=( "${_TESTS[@]}" "lib/001_script" ) + shift + ;; + --text) + _TESTS=( "${_TESTS[@]}" "lib/023_text" ) + shift + ;; + --xsltprocessors) + _XSLTPROCS=( $2 ) + shift 2 + ;; --) - shift - break - ;; + shift + break + ;; *) - exit_on_error "Internal error!" - ;; + exit_on_error "Internal error!" + ;; esac done @@ -218,18 +226,18 @@ done # if [[ -n "${_XSLTPROCS[@]}" ]]; then for _PROC in "${_XSLTPROCS[@]}"; do - which --skip-alias --skip-functions $_PROC >/dev/null 2>&1 - if [ $? -eq 0 ]; then - _XSLT_PROCESSORS=( "${_XSLT_PROCESSORS[@]}" "$_PROC" ) - else - echo "Warning: Did not found xslt processor $_PROC" - fi + which --skip-alias --skip-functions $_PROC >/dev/null 2>&1 + if [ $? -eq 0 ]; then + _XSLT_PROCESSORS=( "${_XSLT_PROCESSORS[@]}" "$_PROC" ) + else + echo "Warning: Did not found xslt processor $_PROC" + fi done else _XSLT_PROCESSORS=( "/usr/bin/xsltproc" ) which --skip-alias --skip-functions /usr/bin/saxon6 >/dev/null 2>&1 if [ $? -eq 0 ]; then - _XSLT_PROCESSORS=( "${_XSLT_PROCESSORS[@]}" "/usr/bin/saxon6" ) + _XSLT_PROCESSORS=( "${_XSLT_PROCESSORS[@]}" "/usr/bin/saxon6" ) fi fi @@ -266,42 +274,42 @@ for _PROC in "${_XSLT_PROCESSORS[@]}"; do # Check return state of tests and act - if e.g. profiling fails it # does not make sense to run the majority of other tests # - case "$_TEST" in - *[_-]pdf) - for _FOPROC in "${_FO_PROCS[@]}"; do - which --skip-alias --skip-functions $_FOPROC >/dev/null 2>&1 - # skip if XSL-FO processor does not exist - [ $? -ne 0 ] && continue - export _FOPROC - eval "$_TEST" - done - ;; - *_profiling) - for _MAIN_PROFILING in "$_MAINPATH" "$_MAINPATH_NOPROF"; do - export _MAIN_PROFILING - if [[ "$_MAIN_PROFILING" =~ _noprofile ]]; then - export _NOPROFILE=1 + case "$_TEST" in + *[_-]pdf) + for _FOPROC in "${_FO_PROCS[@]}"; do + which --skip-alias --skip-functions $_FOPROC >/dev/null 2>&1 + # skip if XSL-FO processor does not exist + [ $? -ne 0 ] && continue + export _FOPROC + eval "$_TEST" + done + ;; + *_profiling) + for _MAIN_PROFILING in "$_MAINPATH" "$_MAINPATH_NOPROF"; do + export _MAIN_PROFILING + if [[ "$_MAIN_PROFILING" =~ _noprofile ]]; then + export _NOPROFILE=1 # when running the noprofile tests, MAIN is replaced # by MAIN_NOPROF - export _PROF_SET_FILES="$_XML_FILES $_MAIN_NOPROF" - else - export _NOPROFILE=0 - export _PROF_SET_FILES="$_XML_FILES $_MAIN" - fi - eval "$_TEST" - done - ;; - *_source-validation) - eval "$_TEST" - if [ $? -ne 0 ]; then - exit_on_error "Fatal: Test documents do not validate, exiting Tests" - fi - ;; - *) - eval "$_TEST" - ;; - esac - echo "...................." + export _PROF_SET_FILES="$_XML_FILES $_MAIN_NOPROF" + else + export _NOPROFILE=0 + export _PROF_SET_FILES="$_XML_FILES $_MAIN" + fi + eval "$_TEST" + done + ;; + *_source-validation) + eval "$_TEST" + if [ $? -ne 0 ]; then + exit_on_error "Fatal: Test documents do not validate, exiting Tests" + fi + ;; + *) + eval "$_TEST" + ;; + esac + echo "...................." done echo done