From 6a7361f713ed3306195a795db2a4b000e8f51fe8 Mon Sep 17 00:00:00 2001 From: Douglas Royds Date: Wed, 28 Nov 2018 17:53:10 +1300 Subject: [PATCH] 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. Signed-off-by: Douglas Royds Signed-off-by: Richard Purdie --- meta/classes/ptest.bbclass | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meta/classes/ptest.bbclass b/meta/classes/ptest.bbclass index fa518f6d454..97865c93385 100644 --- a/meta/classes/ptest.bbclass +++ b/meta/classes/ptest.bbclass @@ -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 } -- 2.47.2