diff mbox series

[scarthgap,2/2] libpcre2: fix RunGrepTest Failure on Busybox systems

Message ID 20260211072322.79206-2-moins@kpit.com
State Rejected, archived
Delegated to: Yoann Congal
Headers show
Series [scarthgap,1/2] libpcre2: Enable Ptest Support | expand

Commit Message

Shaik Moin Feb. 11, 2026, 7:23 a.m. UTC
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>
---
 .../libpcre/libpcre2/0001-test-Fix-head-1-Busybox.patch    | 7 +++----
 meta/recipes-support/libpcre/libpcre2_10.43.bb             | 1 +
 2 files changed, 4 insertions(+), 4 deletions(-)
diff mbox series

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
index 68eaf037a9..e361418d94 100644
--- 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
@@ -9,10 +9,10 @@  BusyBox does not accept the GNU coreutils shorthand forms:
 It requires:
   head -n 1
  
-This causes RunGrepTest test data to fail on
+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`
+Replace all occurrences of `head -1` to `head -n 1`
  
 This aligns the scripts with POSIX syntax and fixes failing
 grep tests in RunGrepTest (including testtrygrep).
@@ -34,5 +34,4 @@  index 1c7bbd2..ab4f310 100755
  echo "RC=$?" >>testtrygrep
 
  echo "---------------------------- Test 133 -----------------------------" >>testtrygrep
--- 
-2.34.1
+
diff --git a/meta/recipes-support/libpcre/libpcre2_10.43.bb b/meta/recipes-support/libpcre/libpcre2_10.43.bb
index 781b5f15ba..ec8676d166 100644
--- a/meta/recipes-support/libpcre/libpcre2_10.43.bb
+++ b/meta/recipes-support/libpcre/libpcre2_10.43.bb
@@ -12,6 +12,7 @@  LIC_FILES_CHKSUM = "file://LICENCE;md5=321a5eb46acae6b6c1ff2c7a866d836a"
 
 SRC_URI = "${GITHUB_BASE_URI}/download/pcre2-${PV}/pcre2-${PV}.tar.bz2 \
            file://run-ptest \
+           file://0001-test-Fix-head-1-Busybox.patch \
 "
 
 GITHUB_BASE_URI = "https://github.com/PCRE2Project/pcre2/releases"