ptest: Optionally strip build host tool info from installed files

Several packages (eg. acl, attr, openssl) install Makefiles or other build host
configuration files for ptest so that they can run `make check`, for instance.
These build host files commonly include paths and versions of build host tools,
(eg. rpm or perl) whose presence and version depends on the build host distro.

Optionally strip lines from installed PTEST_BUILD_HOST_FILES using an
extended regex pattern defined in PTEST_BUILD_HOST_PATTERN. This has no
effect on the on-target ptest.

(From OE-Core rev: a3b657470eeea9f1954bc3a3e593a5c4907b6f17)

Signed-off-by: Douglas Royds <douglas.royds@taitradio.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Douglas Royds
2018-11-28 17:53:10 +13:00
committed by Richard Purdie
parent d3d09bd064
commit fa424823b6

View File

@@ -4,6 +4,7 @@ This package contains a test directory ${PTEST_PATH} for package test purposes."
PTEST_PATH ?= "${libdir}/${BPN}/ptest"
PTEST_BUILD_HOST_FILES ?= "Makefile"
PTEST_BUILD_HOST_PATTERN ?= ""
FILES_${PN}-ptest = "${PTEST_PATH}"
SECTION_${PN}-ptest = "devel"
@@ -56,6 +57,10 @@ do_install_ptest_base() {
-e 's#${WORKDIR}/*=#.=#g' \
-e 's#${WORKDIR}/*##g' \
-i $installed_ptest_file
if [ -n "${PTEST_BUILD_HOST_PATTERN}" ]; then
sed -E '/${PTEST_BUILD_HOST_PATTERN}/d' \
-i $installed_ptest_file
fi
done
done
}