diff mbox series

[meta-oe,kirkstone,1/3] protobuf: fix ptest with python PACKAGECONFIG enabled

Message ID 20250624085748.3060194-1-Qi.Chen@windriver.com
State New
Headers show
Series [meta-oe,kirkstone,1/3] protobuf: fix ptest with python PACKAGECONFIG enabled | expand

Commit Message

ChenQi June 24, 2025, 8:57 a.m. UTC
From: Chen Qi <Qi.Chen@windriver.com>

1. RDEPENDS on python3-protobuf instead of python-protobuf. The
   latter is not available anywhere.
2. Use use python3 interpreter.
3. Fix run-ptest to avoid test failure. An extra '\n' is needed
   to break out the loop.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta-oe/recipes-devtools/protobuf/protobuf/run-ptest | 2 +-
 meta-oe/recipes-devtools/protobuf/protobuf_3.19.6.bb | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/meta-oe/recipes-devtools/protobuf/protobuf/run-ptest b/meta-oe/recipes-devtools/protobuf/protobuf/run-ptest
index b3b2278c47..1112fbdf89 100644
--- a/meta-oe/recipes-devtools/protobuf/protobuf/run-ptest
+++ b/meta-oe/recipes-devtools/protobuf/protobuf/run-ptest
@@ -8,7 +8,7 @@  for write_exe_full_path in ${DIR}/add_person_*; do
 	if [ -x "${write_exe_full_path}" ]; then
 		write_exe=`basename ${write_exe_full_path}`
 		echo "Generating new test file using ${write_exe}..."
-    printf "1234\nname\nname@example.com\n" | ${write_exe_full_path} "${TEST_FILE}"
+    printf "1234\nname\nname@example.com\n\n" | ${write_exe_full_path} "${TEST_FILE}"
 		RETVAL=$?
 		[ $RETVAL -eq 0 ] || exit $RETVAL
 
diff --git a/meta-oe/recipes-devtools/protobuf/protobuf_3.19.6.bb b/meta-oe/recipes-devtools/protobuf/protobuf_3.19.6.bb
index 2b19d07ff8..9bcd208acb 100644
--- a/meta-oe/recipes-devtools/protobuf/protobuf_3.19.6.bb
+++ b/meta-oe/recipes-devtools/protobuf/protobuf_3.19.6.bb
@@ -74,6 +74,7 @@  do_install_ptest() {
 		fi
 	done
 	cp "${S}/${TEST_SRC_DIR}/addressbook_pb2.py" "${D}/${PTEST_PATH}"
+	sed -i -e 's#env python#env python3#' ${D}/${PTEST_PATH}/add_person.py ${D}/${PTEST_PATH}/list_people.py
 	cd "$olddir"
 }
 
@@ -84,7 +85,7 @@  FILES:${PN}-lite = "${libdir}/libprotobuf-lite${SOLIBS}"
 
 RDEPENDS:${PN}-compiler = "${PN}"
 RDEPENDS:${PN}-dev += "${PN}-compiler"
-RDEPENDS:${PN}-ptest = "bash ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python-protobuf', '', d)}"
+RDEPENDS:${PN}-ptest = "bash ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-protobuf', '', d)}"
 
 MIPS_INSTRUCTION_SET = "mips"