From 61e11d51a2a12f85b428f0db5140118de5f2f0fe Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Tue, 26 Apr 2022 08:00:00 +0000 Subject: [PATCH] s/fgrep/grep -F/ --- rpm-4_0.spec | 4 ++-- scripts/cpp.req.in | 4 ++-- scripts/debuginfo.req.in | 2 +- scripts/files.req.files.in | 2 +- scripts/find-package.in | 2 +- scripts/lib.req.in | 20 ++++++++++---------- scripts/shell.req.in | 4 ++-- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/rpm-4_0.spec b/rpm-4_0.spec index ae87d1b..ad3557d 100644 --- a/rpm-4_0.spec +++ b/rpm-4_0.spec @@ -223,8 +223,8 @@ set_c_cflags="$(sed -n 's/^CFLAGS = //p' lib/Makefile) -W -Wno-missing-prototype %make_build -C lib set.lo CFLAGS="$set_c_cflags" %make_build -rpmquery -a --provides |fgrep '= set:' |sort >P -rpmquery -a --requires |fgrep '= set:' |sort >R +rpmquery -a --provides |grep -F '= set:' |sort >P +rpmquery -a --requires |grep -F '= set:' |sort >R join -o 1.3,2.3 P R |shuf >setcmp-data %if_with profile diff --git a/scripts/cpp.req.in b/scripts/cpp.req.in index 614ab3c..da0b022 100755 --- a/scripts/cpp.req.in +++ b/scripts/cpp.req.in @@ -21,7 +21,7 @@ InitPackagedFiles() { PackagedFiles "${1:?}" >$tmpdir/PF sed "s|^|${RPM_BUILD_ROOT-}|" <$tmpdir/PF >$tmpdir/BPF - fgrep -qs -x "$1" $tmpdir/BPF || + grep -F -qs -x "$1" $tmpdir/BPF || Warning "packaged files misconfigured" # Identify packaged files by inode. xargs -r --delimiter='\n' <$tmpdir/BPF \ @@ -96,7 +96,7 @@ CppReq() local f="$1"; shift GlobalPkgInit "$f" - if fgrep -qs -x "$f" $tmpdir/processed; then + if grep -F -qs -x "$f" $tmpdir/processed; then Verbose "$f: already processed" return fi diff --git a/scripts/debuginfo.req.in b/scripts/debuginfo.req.in index e14a3a2..c1e4d01 100755 --- a/scripts/debuginfo.req.in +++ b/scripts/debuginfo.req.in @@ -23,7 +23,7 @@ Debug "RPM_FINDREQ_RPATH=$RPM_FINDREQ_RPATH" not_yet_list= HasDebugInfo() { - if readelf --wide --sections "$1" |LC_ALL=C fgrep -qs '.gnu_debuglink'; then + if readelf --wide --sections "$1" |LC_ALL=C grep -F -qs '.gnu_debuglink'; then return 0 fi if [ -z "$not_yet_list" ] || [ -n "${not_yet_list##* $1 *}" ]; then diff --git a/scripts/files.req.files.in b/scripts/files.req.files.in index 938baef..e11466f 100755 --- a/scripts/files.req.files.in +++ b/scripts/files.req.files.in @@ -1,4 +1,4 @@ #!/bin/sh -efu dirlist=$(set +f; grep -h ^/. @RPMCONFIGDIR@/*-files.req.list | while read -r d pkg; do echo "${d%/}"; done) -cut -f1 |fgrep "${dirlist:?}" || [ $? = 1 ] +cut -f1 |grep -F "${dirlist:?}" || [ $? = 1 ] diff --git a/scripts/find-package.in b/scripts/find-package.in index f16b065..3cb3727 100755 --- a/scripts/find-package.in +++ b/scripts/find-package.in @@ -142,7 +142,7 @@ FindByFile() # install, which is the case if there are packaged files under the # directory. local dirfiles - if dirfiles=$(PackagedFiles |fgrep "$xbrep") && + if dirfiles=$(PackagedFiles |grep -F "$xbrep") && dirfiles=$(echo '' $dirfiles '') && [ -n "${dirfiles##* $xbrep *}" ] && [ -z "${dirfiles##* $xbrep/*}" ]; then diff --git a/scripts/lib.req.in b/scripts/lib.req.in index 09d5707..8fceb42 100755 --- a/scripts/lib.req.in +++ b/scripts/lib.req.in @@ -82,10 +82,10 @@ LibReq() # GNU_IFUNC and GNU_UNIQUE. readelf --wide --dyn-syms "$f" |awk '+$1&&($4=="IFUNC"||$5=="UNIQUE")' >"$tmpdir"/gnu-syms if [ -s "$tmpdir"/gnu-syms ]; then - if LC_ALL=C fgrep -qs ' IFUNC ' "$tmpdir"/gnu-syms; then + if LC_ALL=C grep -F -qs ' IFUNC ' "$tmpdir"/gnu-syms; then echo 'rtld(GNU_IFUNC)' fi - if LC_ALL=C fgrep -qs ' UNIQUE ' "$tmpdir"/gnu-syms; then + if LC_ALL=C grep -F -qs ' UNIQUE ' "$tmpdir"/gnu-syms; then echo 'rtld(GNU_UNIQUE)' fi fi @@ -182,7 +182,7 @@ NF==2 && ($1==name || basename($1)==name) && $1~"^/" && $2~"^[(]0x" {print $1} [ -s "$tmpdir"/a/lib2dep ] || return 0 # Deal with symbols. $elf_ldd --bindings -- "$f" "$rpath" 2>&1 | - LC_ALL=C fgrep "binding file $f [" | + LC_ALL=C grep -F "binding file $f [" | awk '($4!=$7){print$11"\t"$7}' | sed -e "s/[\`']//g" >"$tmpdir"/a/sym2lib [ -s "$tmpdir"/a/sym2lib ] || @@ -263,7 +263,7 @@ EOF while IFS=$'\t' read -r lib dep; do ENABLE_SET_VERSIONS=1 if [ -z "$ENABLE_SET_VERSIONS" ]; then - LC_ALL=C fgrep -qs -x -e "$dep" "$tmpdir"/versioned || + LC_ALL=C grep -F -qs -x -e "$dep" "$tmpdir"/versioned || printf '%s\n' "$dep" continue fi @@ -279,25 +279,25 @@ while IFS=$'\t' read -r lib dep; do # Deal with required symbols. reqsym=$(printf '%s\n' "$lib" |LC_ALL=C join -t$'\t' -12 -o 1.1 "$tmpdir"/sym2lib -) if [ -z "$reqsym" ]; then - LC_ALL=C fgrep -qs -x -e "$dep" "$tmpdir"/versioned || + LC_ALL=C grep -F -qs -x -e "$dep" "$tmpdir"/versioned || printf '%s\n' "$dep" continue fi # Handle standard libraries. - if LC_ALL=C fgrep -qs -x -e "$dep" "$tmpdir"/stddep; then - if ! reqsym=$(printf '%s\n' "$reqsym" |LC_ALL=C fgrep -x -f "$tmpdir"/nonstdsym); then - LC_ALL=C fgrep -qs -x -e "$dep" "$tmpdir"/versioned || + if LC_ALL=C grep -F -qs -x -e "$dep" "$tmpdir"/stddep; then + if ! reqsym=$(printf '%s\n' "$reqsym" |LC_ALL=C grep -F -x -f "$tmpdir"/nonstdsym); then + LC_ALL=C grep -F -qs -x -e "$dep" "$tmpdir"/versioned || printf '%s\n' "$dep" continue fi fi # See if this dep is provided. if [ -z "${lib##${RPM_BUILD_ROOT:-foo}/*}" ] || - rpmquery --whatprovides --provides -- "$dep" |LC_ALL=C fgrep -qs -e "$dep = set:"; then + rpmquery --whatprovides --provides -- "$dep" |LC_ALL=C grep -F -qs -e "$dep = set:"; then : good else Warning "$dep is not yet set-versioned" - LC_ALL=C fgrep -qs -x -e "$dep" "$tmpdir"/versioned || + LC_ALL=C grep -F -qs -x -e "$dep" "$tmpdir"/versioned || printf '%s\n' "$dep" continue fi diff --git a/scripts/shell.req.in b/scripts/shell.req.in index 6270574..f1ee027 100755 --- a/scripts/shell.req.in +++ b/scripts/shell.req.in @@ -126,7 +126,7 @@ ShellReq() printf '%s\n' "$out" | while read -r t r; do [ "$t" = executable ] || continue - if [ -n "$prov" ] && printf '%s\n' "$prov" |fgrep -qs -x -e "$r"; then + if [ -n "$prov" ] && printf '%s\n' "$prov" |grep -F -qs -x -e "$r"; then Verbose "$f: $r() is used before its definition" continue fi @@ -181,7 +181,7 @@ ShellReqEND() dir=${dir%/*} CheckDirProv() { - fgrep -qs -x -e "$r" "$1/.provides.sh" || return + grep -F -qs -x -e "$r" "$1/.provides.sh" || return } if [ -n "${RPM_BUILD_ROOT-}" ] && CheckDirProv "$RPM_BUILD_ROOT$dir"; then # I think that .provides.sh must provide this thingy.