From: Shaik Moin <careers.myinfo@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: careers.myinfo@gmail.com
Subject: [OE-core][kirkstone][PATCH 2/2] libpcre2: fix RunGrepTest Failure on Busybox systems
Date: Tue, 20 Jan 2026 13:07:58 +0530 [thread overview]
Message-ID: <20260120073758.508608-2-moins@kpit.com> (raw)
In-Reply-To: <20260120073758.508608-1-moins@kpit.com>
The PCRE2 RunGrepTest script uses the Gnu Coreutils form:
head -1
Busybox does not support this shorthand option and reports:
head: invalid option --'1'
which cause the grep tests fail when running ptest on yocto.
Replace head -1 with head -n 1 . This makes RunGrepTest work
correctly.
Signed-off-by: Shaik Moin <moins@kpit.com>
---
.../0001-test-Fix-head-1-Busybox.patch | 38 +++++++++++++++++++
.../recipes-support/libpcre/libpcre2_10.40.bb | 1 +
2 files changed, 39 insertions(+)
create mode 100644 meta/recipes-support/libpcre/libpcre2/0001-test-Fix-head-1-Busybox.patch
diff --git a/meta/recipes-support/libpcre/libpcre2/0001-test-Fix-head-1-Busybox.patch b/meta/recipes-support/libpcre/libpcre2/0001-test-Fix-head-1-Busybox.patch
new file mode 100644
index 0000000000..9f98f55380
--- /dev/null
+++ b/meta/recipes-support/libpcre/libpcre2/0001-test-Fix-head-1-Busybox.patch
@@ -0,0 +1,38 @@
+From 1b2c3d4e5f6a7b8c9d0 Mon Sep 17 00:00:00 2001
+From: Shaik Moin <moins@kpit.com>
+Date: Tue, 18 Nov 2025 10:30:00 +0530
+Subject: [PATCH] tests: Fix head options for BusyBox compatibility
+
+BusyBox does not accept the GNU coreutils shorthand forms:
+ head -1
+
+It requires:
+ head -n 1
+
+This causes RunGrepTest and the grepoutput test data to fail on
+Yocto-based systems that use BusyBox.
+
+Replace all occurrences of `head -1` → `head -n 1`
+
+This aligns the scripts with POSIX syntax and fixes failing
+grep tests in RunGrepTest (including testtrygrep).
+
+Upstream-Status: Inappropriate [oe-specific]
+Signed-off-by: Shaik Moin <moins@kpit.com>
+---
+
+diff --git a/RunGrepTest b/RunGrepTest
+index 1c7bbd2..ab4f310 100755
+--- a/RunGrepTest
++++ b/RunGrepTest
+@@ -728,7 +728,7 @@ echo "---------------------------- Test
+ echo "RC=$?" >>testtrygrep
+
+ echo "---------------------------- Test 132 -----------------------------" >>testtrygrep
+-(cd $srcdir; exec 3<testdata/grepinput; $valgrind $vjs $pcre2grep -m1 -A3 '^match' <&3; echo '---'; head -1 <&3; exec 3<&-) >>testtrygrep 2>&1
++(cd $srcdir; exec 3<testdata/grepinput; $valgrind $vjs $pcre2grep -m1 -A3 '^match' <&3; echo '---'; head -n 1 <&3; exec 3<&-) >>testtrygrep 2>&1
+ echo "RC=$?" >>testtrygrep
+
+ echo "---------------------------- Test 133 -----------------------------" >>testtrygrep
+--
+2.34.1
diff --git a/meta/recipes-support/libpcre/libpcre2_10.40.bb b/meta/recipes-support/libpcre/libpcre2_10.40.bb
index 8aec420d4a..0d7786b81c 100644
--- a/meta/recipes-support/libpcre/libpcre2_10.40.bb
+++ b/meta/recipes-support/libpcre/libpcre2_10.40.bb
@@ -13,6 +13,7 @@ LIC_FILES_CHKSUM = "file://LICENCE;md5=41bfb977e4933c506588724ce69bf5d2"
SRC_URI = "https://github.com/PhilipHazel/pcre2/releases/download/pcre2-${PV}/pcre2-${PV}.tar.bz2 \
file://CVE-2022-41409.patch \
file://run-ptest \
+ file://0001-test-Fix-head-1-Busybox.patch \
"
UPSTREAM_CHECK_URI = "https://github.com/PhilipHazel/pcre2/releases"
--
2.34.1
prev parent reply other threads:[~2026-01-20 7:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-20 7:37 [OE-core][kirkstone][PATCH 1/2] libpcre2: Enabling Ptest Support Shaik Moin
2026-01-20 7:37 ` Shaik Moin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260120073758.508608-2-moins@kpit.com \
--to=careers.myinfo@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox