Accepting request 1007674 from home:AndreasStieger:grep

boo#1203096

OBS-URL: https://build.opensuse.org/request/show/1007674
OBS-URL: https://build.opensuse.org/package/show/network:utilities/net-snmp?expand=0&rev=55
This commit is contained in:
Alexander Bergmann 2022-10-05 10:01:24 +00:00 committed by Git OBS Bridge
parent cf9f36a900
commit 772dbc2f88
3 changed files with 340 additions and 0 deletions

333
net-snmp-5.9.3-grep.patch Normal file
View File

@ -0,0 +1,333 @@
From 011de0e8fce88702619ba78cc80c900991a8e036 Mon Sep 17 00:00:00 2001
From: Andreas Stieger <Andreas.Stieger@gmx.de>
Date: Sun, 2 Oct 2022 16:10:38 +0200
Subject: [PATCH 02/10] configure: change use of fgrep to AC detected tool
GNU grep 3.8 started throwing warnings for direct usage,
deprecating it in favour of grep -F
[ bvanassche: regenerated configure script ]
---
configure | 4 ++--
configure.d/config_modules_agent | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/configure b/configure
index 727164eb7..65b99c020 100755
--- a/configure
+++ b/configure
@@ -22257,8 +22257,8 @@ $as_echo "$NETSNMP_DEFAULT_MIBS" >&6; }
#
if echo " $agent_module_list " | \
- fgrep ' agentx/agentx_config ' | \
- fgrep ' agentx/protocol ' > /dev/null ; then
+ $FGREP ' agentx/agentx_config ' | \
+ $FGREP ' agentx/protocol ' > /dev/null ; then
NETSNMP_HAVE_AGENTX_LIBS_TRUE=''
NETSNMP_HAVE_AGENTX_LIBS_FALSE='#'
else
diff --git a/configure.d/config_modules_agent b/configure.d/config_modules_agent
index 1132da8d9..0169749d9 100644
--- a/configure.d/config_modules_agent
+++ b/configure.d/config_modules_agent
@@ -814,8 +814,8 @@ AC_MSG_RESULT($NETSNMP_DEFAULT_MIBS)
#
if echo " $agent_module_list " | \
- fgrep ' agentx/agentx_config ' | \
- fgrep ' agentx/protocol ' > /dev/null ; then
+ $FGREP ' agentx/agentx_config ' | \
+ $FGREP ' agentx/protocol ' > /dev/null ; then
NETSNMP_HAVE_AGENTX_LIBS_TRUE=''
NETSNMP_HAVE_AGENTX_LIBS_FALSE='#'
else
--
2.37.3
From 5ae5ad5234a8e0ef3661fe3ec3c77ae57b156bf5 Mon Sep 17 00:00:00 2001
From: Andreas Stieger <Andreas.Stieger@gmx.de>
Date: Sun, 2 Oct 2022 16:34:17 +0200
Subject: [PATCH 03/10] Makefile.in: change use of egrep to AC detected tool
GNU grep 3.8 started throwing warnings for direct usage,
deprecating it in favour of grep -E
---
Makefile.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.in b/Makefile.in
index 9b0f0dbac..9fe3781e5 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -119,7 +119,7 @@ agentxtrap snmptrapd: @FEATURETARGS@
# local build rules
#
sedscript: sedscript.in include/net-snmp/net-snmp-config.h $(srcdir)/agent/mibgroup/mibdefs.h
- $(CPP) $(srcdir)/sedscript.in | egrep '^s[/#]' | sed 's/REMOVEME//g;s# */#/#g;s/ *#/#/g;s#/ *#/#g;s/# g/#g/;' > sedscript
+ $(CPP) $(srcdir)/sedscript.in | ${EGREP} '^s[/#]' | sed 's/REMOVEME//g;s# */#/#g;s/ *#/#/g;s#/ *#/#g;s/# g/#g/;' > sedscript
echo 's/VERSIONINFO/$(VERSION)/g' >> sedscript
echo 's#DATADIR#$(datadir)#g' >> sedscript
echo 's#LIBDIR#$(libdir)#g' >> sedscript
--
2.37.3
From 9a577171ce728b97aeb42c455f5d09a2c3e2b51f Mon Sep 17 00:00:00 2001
From: Andreas Stieger <Andreas.Stieger@gmx.de>
Date: Sun, 2 Oct 2022 16:35:22 +0200
Subject: [PATCH 04/10] dist: update instructions and scripts to use grep -E
GNU grep 3.8 started throwing warnings for direct usage of egrep,
deprecating it in favour of grep -E
---
dist/RELEASE-INSTRUCTIONS | 2 +-
dist/makerelease.xml | 4 ++--
dist/net-snmp-solaris-build/buildpackage-solaris | 2 +-
dist/nsb-functions | 4 ++--
dist/patme | 2 +-
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/dist/RELEASE-INSTRUCTIONS b/dist/RELEASE-INSTRUCTIONS
index 032a0c92e..a38e46a6d 100644
--- a/dist/RELEASE-INSTRUCTIONS
+++ b/dist/RELEASE-INSTRUCTIONS
@@ -87,7 +87,7 @@ STEP: 1.6: Check for changes
Commands to execute:
- svn -u status | egrep '^[^\?]'
+ svn -u status | grep -E '^[^\?]'
(Leaving Step: 1)
diff --git a/dist/makerelease.xml b/dist/makerelease.xml
index 0494fd098..f3c8bfa0e 100644
--- a/dist/makerelease.xml
+++ b/dist/makerelease.xml
@@ -21,7 +21,7 @@
them before continuing!
</text>
<commands>
- <command expectfailure="1">find . -name 'net-snmp-5*' | egrep '^[^\?]'</command>
+ <command expectfailure="1">find . -name 'net-snmp-5*' | grep -E '^[^\?]'</command>
</commands>
</step>
<step type="system" title="Setup Check">
@@ -130,7 +130,7 @@
this step finds outstanding modified files you need to check
them in or revert them before continuing!</text>
<commands>
- <command expectfailure="1">git status --porcelain | egrep '^[^\?]'</command>
+ <command expectfailure="1">git status --porcelain | grep -E '^[^\?]'</command>
</commands>
</step>
</steps>
diff --git a/dist/net-snmp-solaris-build/buildpackage-solaris b/dist/net-snmp-solaris-build/buildpackage-solaris
index 31f4f0c0e..72971111a 100644
--- a/dist/net-snmp-solaris-build/buildpackage-solaris
+++ b/dist/net-snmp-solaris-build/buildpackage-solaris
@@ -94,7 +94,7 @@ f snmp /etc/init.d/snmpd=./snmpd-init.d 0755 root sys
==
pkgproto -c snmp $TMP=/ |\
-egrep -v '^d .* / |^d .* /var |^d .* /opt |^ .*perllocal.pod=' |\
+grep -E -v '^d .* / |^d .* /var |^d .* /opt |^ .*perllocal.pod=' |\
sed -e "s/ $owner $group\$//" >> prototype || exit $?
# and ignore top level directories (must pre-exist)
diff --git a/dist/nsb-functions b/dist/nsb-functions
index 4865cc28a..f42a527a8 100644
--- a/dist/nsb-functions
+++ b/dist/nsb-functions
@@ -364,10 +364,10 @@ nsb_make()
# checking $? would only get us the rc from tee, which is useless
nsb_info "Checking for errors..."
- egrep -i "error|fail|warn|no such|exists|t find |ermission denied" $nsb_make_OUTPUT \
+ grep -E -i "error|fail|warn|no such|exists|t find |ermission denied" $nsb_make_OUTPUT \
> nsb_make-$target-allerrs.$NSB_DATE
# allow for a few exceptions
- egrep -v -i "^ok|testing .*failure|[a-z&_](fail|error)|warn|error(mib|\.3)|(LOG|SNMP)_ERR|In function|= FAILURE|DEBUGMSG|/\*|static library .* is not portable" nsb_make-$target-allerrs.$NSB_DATE \
+ grep -E -v -i "^ok|testing .*failure|[a-z&_](fail|error)|warn|error(mib|\.3)|(LOG|SNMP)_ERR|In function|= FAILURE|DEBUGMSG|/\*|static library .* is not portable" nsb_make-$target-allerrs.$NSB_DATE \
> nsb_make-$target-errs.$NSB_DATE
if [ -s nsb_make-$target-errs.$NSB_DATE ]; then
nsb_prompt "press enter to view errors"
diff --git a/dist/patme b/dist/patme
index 0fd50ee4a..6e62c80f9 100755
--- a/dist/patme
+++ b/dist/patme
@@ -101,7 +101,7 @@ sub load_primaries {
patch_info =>
qw_primary('check','Checking code directory status:', '',
[qw_paragraph('patch pieces:',
- sub { capture("egrep '^(---|\\+\\+\\+)' " .
+ sub { capture("grep -E '^(---|\\+\\+\\+)' " .
qwparam('patchfile'))},
width => 80,
height => 30),
--
2.37.3
From 1023b76d53a279d44fa0629c1fd3a3b82d39eb42 Mon Sep 17 00:00:00 2001
From: Andreas Stieger <Andreas.Stieger@gmx.de>
Date: Sun, 2 Oct 2022 16:36:57 +0200
Subject: [PATCH 05/10] local: convert direct usage of egrep to grep -E
GNU grep 3.8 started throwing warnings for direct usage,
deprecating it in favour of grep -E
[ bvanassche: changed one occurrence of egrep into grep -F instead of grep ]
---
local/gittools/shell-functions | 6 +++---
local/mib2c-update | 4 ++--
local/minimalist/feature-remove | 6 +++---
local/snmp-ucd.sh | 2 +-
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/local/gittools/shell-functions b/local/gittools/shell-functions
index eafcbfdb4..0b09df323 100644
--- a/local/gittools/shell-functions
+++ b/local/gittools/shell-functions
@@ -26,7 +26,7 @@ _ns_switchtobuilddir () {
_ns_getbuilddir() {
nssuffix=${1:-$nssuffix}
- nsbranch=`git branch | egrep '^\*' | sed 's/^..//'`
+ nsbranch=`git branch | grep -E '^\*' | sed 's/^..//'`
NSBUILDDIR="$nsbuildroot/$nsbranch"
NSSRCDIR="$PWD"
@@ -334,7 +334,7 @@ nsrollup() {
fi
if [ -f dist/release ] ; then
- if [ "`egrep ^$branch dist/release`" = "$branch rc" ] ; then
+ if [ "`grep -E ^$branch dist/release`" = "$branch rc" ] ; then
$nsverbose Skipping: branch is in rc phase of release
nsbranchesnotdone="$nsbranchesnotdone $branch"
@@ -411,7 +411,7 @@ nsrollup() {
}
nspull() {
- nscurrentbranch=`git branch | egrep '^\*' | sed 's/^..//'`
+ nscurrentbranch=`git branch | grep -E '^\*' | sed 's/^..//'`
_ns_checkclean
if [ $NSCLEAN != 1 ]; then
return
diff --git a/local/mib2c-update b/local/mib2c-update
index 4282f3332..5fe5fd33d 100755
--- a/local/mib2c-update
+++ b/local/mib2c-update
@@ -157,7 +157,7 @@ do_cp()
die "src $src is not a directory"
fi
safecd "$src"
- files=`ls ./*"$UPDATE_OID"* 2>/dev/null| egrep "(file|onf|m2d|txt|\.c|\.h)$"`
+ files=`ls ./*"$UPDATE_OID"* 2>/dev/null| grep -E "(file|onf|m2d|txt|\.c|\.h)$"`
if [ -z "$files" ]; then
echo " no files to copy from $src"
else
@@ -174,7 +174,7 @@ do_cp()
save_diff()
{
echo "Creating patch for your custom code"
- cnt=`ls ./"$UPDATE_CURR/"*"$UPDATE_OID"* 2>/dev/null | egrep "(file|onf|m2d|txt|\.c|\.h)$" | wc -l`
+ cnt=`ls ./"$UPDATE_CURR/"*"$UPDATE_OID"* 2>/dev/null | grep -E "(file|onf|m2d|txt|\.c|\.h)$" | wc -l`
if [ "$cnt" -eq 0 ]; then
echo " no custom code!"
FIRST_RUN=1
diff --git a/local/minimalist/feature-remove b/local/minimalist/feature-remove
index aae340d93..504f26e0b 100755
--- a/local/minimalist/feature-remove
+++ b/local/minimalist/feature-remove
@@ -99,15 +99,15 @@ for i in `grep NETSNMP_FEATURE_PROVIDE_ $featureheaderin | sed 's/.*FEATURE_PROV
#
# check to see if something required a parent
#
- elif egrep NETSNMP_FEATURE_${i}_CHILD_OF $featureheaderglobal > /dev/null ; then
- parentnames=`egrep NETSNMP_FEATURE_${i}_CHILD_OF $featureheaderglobal | sed 's/.*CHILD_OF_//;s/ .*//;'`
+ elif grep -E NETSNMP_FEATURE_${i}_CHILD_OF $featureheaderglobal > /dev/null ; then
+ parentnames=`grep -E NETSNMP_FEATURE_${i}_CHILD_OF $featureheaderglobal | sed 's/.*CHILD_OF_//;s/ .*//;'`
foundone=0
for parentname in $parentnames ; do
# if the parent was desired, then we are too:
if test $foundone = 0 ; then
- if egrep "NETSNMP_FEATURE_HAS_${parentname} " $featureheader > /dev/null ; then
+ if grep -E "NETSNMP_FEATURE_HAS_${parentname} " $featureheader > /dev/null ; then
echo "#define NETSNMP_FEATURE_HAS_$i 1" >> $featureheader
haslist="${haslist}${i} "
foundone=1
diff --git a/local/snmp-ucd.sh b/local/snmp-ucd.sh
index 7d16b746a..98d4094d0 100755
--- a/local/snmp-ucd.sh
+++ b/local/snmp-ucd.sh
@@ -60,7 +60,7 @@ killproc() { # <program> [signal]
#
pid=`pidofproc $base 2>/dev/null`
[ -z "$pid" ] && {
- pid=`ps $PSARGS | egrep $base | egrep -v egrep | egrep -v $0 | awk '{ print $2 }'`;
+ pid=`ps $PSARGS | grep -F "$base" | grep -v grep | grep -v $0 | awk '{ print $2 }'`;
}
[ -z "$pid" ] && {
echo "`basename $0`: killproc: Could not find process ID."
--
2.37.3
From 2b048bbe20d0e17ed6091c7ee75abc78e27423b5 Mon Sep 17 00:00:00 2001
From: Andreas Stieger <Andreas.Stieger@gmx.de>
Date: Sun, 2 Oct 2022 16:38:37 +0200
Subject: [PATCH 06/10] net-snmp-create-v3-user: convert egrep to grep -E
GNU grep 3.8 started throwing warnings for direct usage,
deprecating it in favour of grep -E
---
net-snmp-create-v3-user.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net-snmp-create-v3-user.in b/net-snmp-create-v3-user.in
index 19895a178..87121b9a1 100644
--- a/net-snmp-create-v3-user.in
+++ b/net-snmp-create-v3-user.in
@@ -3,7 +3,7 @@
# this shell script is designed to add new SNMPv3 users
# to Net-SNMP config file.
-if @PSCMD@ | egrep ' snmpd *$' > /dev/null 2>&1 ; then
+if @PSCMD@ | @EGREP@ ' snmpd *$' > /dev/null 2>&1 ; then
echo "Apparently at least one snmpd demon is already running."
echo "You must stop them in order to use this command."
exit 1
--
2.37.3
From bc314524507e39cc283904e69d2a670e1ee7a6be Mon Sep 17 00:00:00 2001
From: Andreas Stieger <Andreas.Stieger@gmx.de>
Date: Sun, 2 Oct 2022 16:39:57 +0200
Subject: [PATCH 07/10] testing/fulltests/support/simple_eval_tools.sh: egrep
to grep -E
GNU grep 3.8 started throwing warnings for direct usage,
deprecating it in favour of grep -E
---
testing/fulltests/support/simple_eval_tools.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testing/fulltests/support/simple_eval_tools.sh b/testing/fulltests/support/simple_eval_tools.sh
index 4b2178618..858c20f75 100644
--- a/testing/fulltests/support/simple_eval_tools.sh
+++ b/testing/fulltests/support/simple_eval_tools.sh
@@ -474,7 +474,7 @@ CHECKANDDIE() {
# Returns: Count of matched lines.
#
CHECKEXACT() { # <pattern_to_match_exactly>
- rval=`egrep -c "^$*\$|^$*[^a-zA-Z0-9_]|[^a-zA-Z0-9_]$*\$|[^a-zA-Z0-9_]$*[^a-zA-Z0-9_]" "$junkoutputfile" 2>/dev/null`
+ rval=`grep -E -c "^$*\$|^$*[^a-zA-Z0-9_]|[^a-zA-Z0-9_]$*\$|[^a-zA-Z0-9_]$*[^a-zA-Z0-9_]" "$junkoutputfile" 2>/dev/null`
snmp_last_test_result=$rval
EXPECTRESULT 1 # default
return $rval
--
2.37.3

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Oct 3 11:45:51 UTC 2022 - Andreas Stieger <andreas.stieger@gmx.de>
- change egrep/fgrep to grep -E/-F to avoid warnings boo#1203096
add net-snmp-5.9.3-grep.patch
-------------------------------------------------------------------
Tue Sep 27 14:56:27 UTC 2022 - Alexander Bergmann <abergmann@suse.com>

View File

@ -64,6 +64,7 @@ Patch13: net-snmp-5.9.1-suse-systemd-service-files.patch
Patch14: net-snmp-5.9.2-fix-create-v3-user-outfile.patch
Patch15: net-snmp-5.9.1-subagent-set-response.patch
Patch16: net-snmp-5.9.3-fixed-python2-bindings.patch
Patch17: net-snmp-5.9.3-grep.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: autoconf