shell.req.in: quote grep arguments with "--"

There's a bug in "sh --rpm-requires" mode:

$ sh --rpm-requires /dev/stdin <<<'exec -a PERL /usr/bin/perl'
executable(-a)
$

Then "-a" is passed to grep as its first argument (search pattern).
This commit is contained in:
Alexey Tourbin 2007-08-03 19:04:29 +04:00
parent 3ed0194c90
commit 60ca916d3b

View File

@ -63,9 +63,9 @@ FindReqs()
alias|keyword|function|builtin)
continue ;;
esac
if grep -qs -Fx "$r" "${RPM_BUILD_ROOT-}$dname/.provides.sh"; then
if grep -qs -Fx -- "$r" "${RPM_BUILD_ROOT-}$dname/.provides.sh"; then
printf %s\\n "$dname($r)"
elif grep -qs -Fx "$r" "$dname/.provides.sh"; then
elif grep -qs -Fx -- "$r" "$dname/.provides.sh"; then
printf %s\\n "$dname($r)"
else
FindPackage "$file" "$r"