s/fgrep/grep -F/

This commit is contained in:
Дмитрий Левин 2022-04-26 08:00:00 +00:00
parent cf44c38b35
commit 61e11d51a2
7 changed files with 19 additions and 19 deletions

View File

@ -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 -C lib set.lo CFLAGS="$set_c_cflags"
%make_build %make_build
rpmquery -a --provides |fgrep '= set:' |sort >P rpmquery -a --provides |grep -F '= set:' |sort >P
rpmquery -a --requires |fgrep '= set:' |sort >R rpmquery -a --requires |grep -F '= set:' |sort >R
join -o 1.3,2.3 P R |shuf >setcmp-data join -o 1.3,2.3 P R |shuf >setcmp-data
%if_with profile %if_with profile

View File

@ -21,7 +21,7 @@ InitPackagedFiles()
{ {
PackagedFiles "${1:?}" >$tmpdir/PF PackagedFiles "${1:?}" >$tmpdir/PF
sed "s|^|${RPM_BUILD_ROOT-}|" <$tmpdir/PF >$tmpdir/BPF 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" Warning "packaged files misconfigured"
# Identify packaged files by inode. # Identify packaged files by inode.
xargs -r --delimiter='\n' <$tmpdir/BPF \ xargs -r --delimiter='\n' <$tmpdir/BPF \
@ -96,7 +96,7 @@ CppReq()
local f="$1"; shift local f="$1"; shift
GlobalPkgInit "$f" GlobalPkgInit "$f"
if fgrep -qs -x "$f" $tmpdir/processed; then if grep -F -qs -x "$f" $tmpdir/processed; then
Verbose "$f: already processed" Verbose "$f: already processed"
return return
fi fi

View File

@ -23,7 +23,7 @@ Debug "RPM_FINDREQ_RPATH=$RPM_FINDREQ_RPATH"
not_yet_list= not_yet_list=
HasDebugInfo() 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 return 0
fi fi
if [ -z "$not_yet_list" ] || [ -n "${not_yet_list##* $1 *}" ]; then if [ -z "$not_yet_list" ] || [ -n "${not_yet_list##* $1 *}" ]; then

View File

@ -1,4 +1,4 @@
#!/bin/sh -efu #!/bin/sh -efu
dirlist=$(set +f; grep -h ^/. @RPMCONFIGDIR@/*-files.req.list | dirlist=$(set +f; grep -h ^/. @RPMCONFIGDIR@/*-files.req.list |
while read -r d pkg; do echo "${d%/}"; done) while read -r d pkg; do echo "${d%/}"; done)
cut -f1 |fgrep "${dirlist:?}" || [ $? = 1 ] cut -f1 |grep -F "${dirlist:?}" || [ $? = 1 ]

View File

@ -142,7 +142,7 @@ FindByFile()
# install, which is the case if there are packaged files under the # install, which is the case if there are packaged files under the
# directory. # directory.
local dirfiles local dirfiles
if dirfiles=$(PackagedFiles |fgrep "$xbrep") && if dirfiles=$(PackagedFiles |grep -F "$xbrep") &&
dirfiles=$(echo '' $dirfiles '') && dirfiles=$(echo '' $dirfiles '') &&
[ -n "${dirfiles##* $xbrep *}" ] && [ -n "${dirfiles##* $xbrep *}" ] &&
[ -z "${dirfiles##* $xbrep/*}" ]; then [ -z "${dirfiles##* $xbrep/*}" ]; then

View File

@ -82,10 +82,10 @@ LibReq()
# GNU_IFUNC and GNU_UNIQUE. # GNU_IFUNC and GNU_UNIQUE.
readelf --wide --dyn-syms "$f" |awk '+$1&&($4=="IFUNC"||$5=="UNIQUE")' >"$tmpdir"/gnu-syms readelf --wide --dyn-syms "$f" |awk '+$1&&($4=="IFUNC"||$5=="UNIQUE")' >"$tmpdir"/gnu-syms
if [ -s "$tmpdir"/gnu-syms ]; then 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)' echo 'rtld(GNU_IFUNC)'
fi 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)' echo 'rtld(GNU_UNIQUE)'
fi fi
fi fi
@ -182,7 +182,7 @@ NF==2 && ($1==name || basename($1)==name) && $1~"^/" && $2~"^[(]0x" {print $1}
[ -s "$tmpdir"/a/lib2dep ] || return 0 [ -s "$tmpdir"/a/lib2dep ] || return 0
# Deal with symbols. # Deal with symbols.
$elf_ldd --bindings -- "$f" "$rpath" 2>&1 | $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}' | awk '($4!=$7){print$11"\t"$7}' |
sed -e "s/[\`']//g" >"$tmpdir"/a/sym2lib sed -e "s/[\`']//g" >"$tmpdir"/a/sym2lib
[ -s "$tmpdir"/a/sym2lib ] || [ -s "$tmpdir"/a/sym2lib ] ||
@ -263,7 +263,7 @@ EOF
while IFS=$'\t' read -r lib dep; do while IFS=$'\t' read -r lib dep; do
ENABLE_SET_VERSIONS=1 ENABLE_SET_VERSIONS=1
if [ -z "$ENABLE_SET_VERSIONS" ]; then 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" printf '%s\n' "$dep"
continue continue
fi fi
@ -279,25 +279,25 @@ while IFS=$'\t' read -r lib dep; do
# Deal with required symbols. # Deal with required symbols.
reqsym=$(printf '%s\n' "$lib" |LC_ALL=C join -t$'\t' -12 -o 1.1 "$tmpdir"/sym2lib -) reqsym=$(printf '%s\n' "$lib" |LC_ALL=C join -t$'\t' -12 -o 1.1 "$tmpdir"/sym2lib -)
if [ -z "$reqsym" ]; then 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" printf '%s\n' "$dep"
continue continue
fi fi
# Handle standard libraries. # Handle standard libraries.
if LC_ALL=C fgrep -qs -x -e "$dep" "$tmpdir"/stddep; then if LC_ALL=C grep -F -qs -x -e "$dep" "$tmpdir"/stddep; then
if ! reqsym=$(printf '%s\n' "$reqsym" |LC_ALL=C fgrep -x -f "$tmpdir"/nonstdsym); then if ! reqsym=$(printf '%s\n' "$reqsym" |LC_ALL=C grep -F -x -f "$tmpdir"/nonstdsym); 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" printf '%s\n' "$dep"
continue continue
fi fi
fi fi
# See if this dep is provided. # See if this dep is provided.
if [ -z "${lib##${RPM_BUILD_ROOT:-foo}/*}" ] || 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 : good
else else
Warning "$dep is not yet set-versioned" 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" printf '%s\n' "$dep"
continue continue
fi fi

View File

@ -126,7 +126,7 @@ ShellReq()
printf '%s\n' "$out" | printf '%s\n' "$out" |
while read -r t r; do while read -r t r; do
[ "$t" = executable ] || continue [ "$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" Verbose "$f: $r() is used before its definition"
continue continue
fi fi
@ -181,7 +181,7 @@ ShellReqEND()
dir=${dir%/*} dir=${dir%/*}
CheckDirProv() 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 if [ -n "${RPM_BUILD_ROOT-}" ] && CheckDirProv "$RPM_BUILD_ROOT$dir"; then
# I think that .provides.sh must provide this thingy. # I think that .provides.sh must provide this thingy.