File logwatch-7.5.5-egrep.patch of Package logwatch

From: Andreas Stieger <Andreas.Stieger@gmx.de>
Date: Thu, 22 Sep 2022 21:53:27 +0200
References: boo#1293665

Index: logwatch-7.7/scripts/logwatch.pl
===================================================================
--- logwatch-7.7.orig/scripts/logwatch.pl
+++ logwatch-7.7/scripts/logwatch.pl
@@ -702,7 +702,7 @@ $ENV{'LOGWATCH_NUMERIC'} = $Config{'nume
 $ENV{'HOSTNAME'} = $Config{'hostname'};
 $ENV{'OSname'} = $OSname;
 
-my $no_egrep =  system("egrep -V > /dev/null 2>&1");
+my $no_egrep =  system("grep -E -V > /dev/null 2>&1");
 
 #split and splitmail also play with LOGWATCH_ONLY_HOSTNAME which is not shown by debug
 if ($Config{'hostlimit'}) {
@@ -1401,11 +1401,11 @@ sub parselogs {
             $Command = " ( $Config{'pathtocat'} $FileText| " ;
             if ($ServiceData{$Service}{pre_ignore}) {
                if ($no_egrep) {
-                  die "No egrep executable found, which is required when\n" .
+                  die "No working grep -E found, which is required when\n" .
                       "using the Pre_Ignore variable in configuration \n" .
                       "file ${Service}.conf\n";
                } else {
-                  $Command .= "egrep -v \"$ServiceData{$Service}{pre_ignore}\" | ";
+                  $Command .= "grep -E -v \"$ServiceData{$Service}{pre_ignore}\" | ";
                }
             }
             if ($HostStrip ne " ") {
Index: logwatch-7.7/scripts/shared/onlycontains
===================================================================
--- logwatch-7.7.orig/scripts/shared/onlycontains
+++ logwatch-7.7/scripts/shared/onlycontains
@@ -20,9 +20,9 @@
 
 use strict;
 
-# Just does a case-insensitive egrep ;)
+# Just does a case-insensitive grep -E ;)
 
-system("egrep -i \"@ARGV\"");
+system("grep -E -i \"@ARGV\"");
 
 # vi: shiftwidth=3 syntax=perl tabstop=3 et
 # Local Variables:
Index: logwatch-7.7/scripts/shared/remove
===================================================================
--- logwatch-7.7.orig/scripts/shared/remove
+++ logwatch-7.7/scripts/shared/remove
@@ -20,10 +20,10 @@
 
 use strict;
 
-# Just a case-insensitive, inverse egrep
+# Just a case-insensitive, inverse grep -E
 
-#/bin/egrep -vi "$@"
-system("egrep -vi \"@ARGV\"");
+#/bin/grep -E -vi "$@"
+system("grep -E -vi \"@ARGV\"");
 
 # vi: shiftwidth=3 syntax=perl tabstop=3 et
 # Local Variables:
openSUSE Build Service is sponsored by