]> code.ossystems Code Review - openembedded-core.git/commitdiff
ptest: Optionally strip build host tool info from installed files
authorDouglas Royds <douglas.royds@taitradio.com>
Wed, 28 Nov 2018 04:53:10 +0000 (17:53 +1300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 3 Dec 2018 12:19:42 +0000 (12:19 +0000)
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 <douglas.royds@taitradio.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/ptest.bbclass

index fa518f6d4540cf00167556ec800142f6a4a8ff92..97865c933859726bca937721c25491c572ea886c 100644 (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
 }