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 <[email protected]>
---
 .../libpcre2/0001-test-Fix-head-1-Busybox.patch | 17 ++++++++---------
 meta/recipes-support/libpcre/libpcre2_10.40.bb  |  1 +
 2 files changed, 9 insertions(+), 9 deletions(-)

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 de37888854..d17ec6a731 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
@@ -5,22 +5,22 @@ 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`
- 
+
+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).
- 
+
 Upstream-Status: Inappropriate [oe-specific]
 Signed-off-by: Shaik Moin <[email protected]>
 ---
- 
+
 diff --git a/RunGrepTest b/RunGrepTest
 index 1c7bbd2..ab4f310 100755
 --- a/RunGrepTest
@@ -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.40.bb 
b/meta/recipes-support/libpcre/libpcre2_10.40.bb
index cd9ae7563c..1d10c2e9b8 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

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#230968): 
https://lists.openembedded.org/g/openembedded-core/message/230968
Mute This Topic: https://lists.openembedded.org/mt/117753200/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to