diff -aur src/openscap-1.2.8/tests/test_common.sh.in src/openscap-1.2.8-patch/tests/test_common.sh.in --- src/openscap-1.2.8/tests/test_common.sh.in 2016-01-18 10:18:42.000000000 +0100 +++ src/openscap-1.2.8-patch/tests/test_common.sh.in 2016-04-13 22:15:31.866559193 +0200 @@ -26,11 +26,7 @@ export XMLDIFF="@abs_top_srcdir@/tests/xmldiff.pl" -if ! XPATH=`command -v xpath 2>&1`; then - echo "I require xpath tool but it's not installed. Aborting." >&2 - exit 1 -fi -export XPATH +export XPATH=xpath_wrapper # Overall test result. result=0 @@ -163,3 +160,18 @@ fi } export -f assert_exists + +xpath_wrapper() { +XPATH_BIN="/usr/bin/vendor_perl/xpath" +if [ "$#" -eq 1 ]; +then + # read file from stdin + xpath_expr="$1" + $XPATH_BIN -e "$xpath_expr" +else + file="$1" + xpath_expr="$2" + $XPATH_BIN -e "$xpath_expr" "$file" +fi +} +export -f xpath_wrapper