diff mbox series

[meta-selinux] policycoreutils: fix egrep regression warning

Message ID 20260916023924.429106-1-chenqi_hycx@cetc.com.cn
State New
Headers show
Series [meta-selinux] policycoreutils: fix egrep regression warning | expand

Commit Message

Chen Qi Sept. 16, 2026, 2:39 a.m. UTC
From: Chen Qi <chenqi_hycx@cetc.com.cn>

Command and output are as below:
```
root@qemuarm64:~# fixfiles check /etc/
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
egrep: warning: egrep is obsolescent; using grep -E
```

In fact, the egrep issue had been fixed upstream since 2022[1].
The egrep warning was introduced by the local patch. Fix to use
'grep -E' in the local patch to avoid the runtime deprecation warning.

[1] https://github.com/SELinuxProject/selinux/commit/df31981d635d421d304ee10beb7f19bfa36dd385

Signed-off-by: Chen Qi <chenqi_hycx@cetc.com.cn>
---
 .../policycoreutils-fixfiles-de-bashify.patch      | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/recipes-security/selinux/policycoreutils/policycoreutils-fixfiles-de-bashify.patch b/recipes-security/selinux/policycoreutils/policycoreutils-fixfiles-de-bashify.patch
index 9b94353..3394227 100644
--- a/recipes-security/selinux/policycoreutils/policycoreutils-fixfiles-de-bashify.patch
+++ b/recipes-security/selinux/policycoreutils/policycoreutils-fixfiles-de-bashify.patch
@@ -1,4 +1,4 @@ 
-From c0675c5dc7e59b345cbd62fd134ef950f3474c22 Mon Sep 17 00:00:00 2001
+From 42d591004563de3ecf8212423932b955c9f4cef8 Mon Sep 17 00:00:00 2001
 From: Joe MacDonald <joe_macdonald@mentor.com>
 Date: Fri, 20 Feb 2015 17:00:19 -0500
 Subject: [PATCH] fixfiles: de-bashify
@@ -14,12 +14,15 @@  Upstream-Status: Inappropriate [embedded specific]
 
 Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
 Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+
+[Fix the egrep deprecation issue.]
+Signed-off-by: Chen Qi <chenqi_hycx@cetc.com.cn>
 ---
  policycoreutils/scripts/fixfiles | 23 ++++++++++++++---------
  1 file changed, 14 insertions(+), 9 deletions(-)
 
 diff --git a/policycoreutils/scripts/fixfiles b/policycoreutils/scripts/fixfiles
-index b7cd765c..38497765 100755
+index b7cd765..5dbf3fb 100755
 --- a/policycoreutils/scripts/fixfiles
 +++ b/policycoreutils/scripts/fixfiles
 @@ -1,4 +1,4 @@
@@ -44,8 +47,8 @@  index b7cd765c..38497765 100755
 -	  [[ "${i}" =~ ^[[:blank:]]*# ]] && continue
 -	  [[ ! "${i}" =~ ^/.* ]] && continue
 -	  [[ ! -d "${i}" ]] && continue
-+	  echo "${i}" | egrep -q '^[[:space:]]*#' && continue
-+	  echo "${i}" | egrep -v '^/.*' && continue
++	  echo "${i}" | grep -E -q '^[[:space:]]*#' && continue
++	  echo "${i}" | grep -E -v '^/.*' && continue
 +	  [ ! -d "${i}" ] && continue
 +
  	  exclude_from_relabelling="$exclude_from_relabelling -e $i"
@@ -84,6 +87,3 @@  index b7cd765c..38497765 100755
  	fullrelabel
  	return
      fi
--- 
-2.34.1
-