File apparmor-3.0.7-egrep.patch of Package apparmor

From e8f3a1b87853da22fa8c23c49ca876b6d6997a41 Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal.vasilek@nic.cz>
Date: Tue, 24 Aug 2021 09:44:07 +0200
Subject: [PATCH] aa-decode: use grep -E instead of egrep

egrep and fgrep are deprecated and will print a warning in the next grep
release (3.8)

https://git.savannah.gnu.org/cgit/grep.git/commit/?id=a9515624709865d480e3142fd959bccd1c9372d1
Signed-off-by: Michal Vasilek <michal.vasilek@nic.cz>
---
 utils/aa-decode | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/utils/aa-decode b/utils/aa-decode
index 16f23b55b..35e426aff 100755
--- a/utils/aa-decode
+++ b/utils/aa-decode
@@ -37,7 +37,7 @@ EOM
 }
 
 decode() {
-    if echo "$1" | egrep -q "^[0-9A-Fa-f]+$" ; then
+    if echo "$1" | grep -E -q "^[0-9A-Fa-f]+$" ; then
       python3 -c "import binascii; print(bytes.decode(binascii.unhexlify('$1'), errors='strict'));"
     else
       echo ""
@@ -53,7 +53,7 @@ fi
 # if have an argument, then use it, otherwise process stdin
 if [ -n "$1" ]; then
     e="$1"
-    if ! echo "$e" | egrep -q "^[0-9A-Fa-f]+$" ; then
+    if ! echo "$e" | grep -E -q "^[0-9A-Fa-f]+$" ; then
         echo "String should only contain hex characters (0-9, a-f, A-F)"
         exit 1
     fi
-- 
GitLab

openSUSE Build Service is sponsored by