]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
ptest.bbclass: Handle the case when Makefile does not exist in do_install_ptest_base
authorKhem Raj <raj.khem@gmail.com>
Wed, 7 Feb 2024 06:02:38 +0000 (22:02 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 8 Feb 2024 10:58:31 +0000 (10:58 +0000)
Some recipes e.g. expant generate ninja files and no Makefile may exist,
therefore grep -q would fail on a non-existent file, we just need the
return code  to decide if intall-ptest target should be run or not.

Fixes errors like
| grep: Makefile: No such file or directory

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-recipe/ptest.bbclass

index a1c3c3f1a653e6a566622c72c6d3d05e7e54dbf0..348d729aef108d87ec153ef7dd439242de3dd840 100644 (file)
@@ -56,9 +56,9 @@ do_install_ptest_base() {
     if [ -f ${WORKDIR}/run-ptest ]; then
         install -D ${WORKDIR}/run-ptest ${D}${PTEST_PATH}/run-ptest
     fi
-    if grep -q install-ptest: Makefile; then
-        oe_runmake DESTDIR=${D}${PTEST_PATH} install-ptest
-    fi
+
+    grep -q install-ptest: Makefile 2>/dev/null && oe_runmake DESTDIR=${D}${PTEST_PATH} install-ptest
+
     do_install_ptest
     chown -R root:root ${D}${PTEST_PATH}