pck-update: fix build requirements generation with multiple providers

When --whatprovides returns multiple requirements only consider the first one.
Seen with mono(..) requirements in monodevelop.
This commit is contained in:
Silvan Calarco 2013-07-17 14:32:17 +02:00
parent fcdf10374f
commit b597848f6b

View File

@ -2262,7 +2262,7 @@ $(echo $solibpath | sed "s|-[0-9.]*\.so|.so|")"
elif [[ "$req" =~ .*\(.*\) || "$req" =~ .*\.so ]]; then elif [[ "$req" =~ .*\(.*\) || "$req" =~ .*\.so ]]; then
# a(b) requirement or *.so library # a(b) requirement or *.so library
rpm -q --qf %{name} --whatprovides "$req" &>/dev/null && rpm -q --qf %{name} --whatprovides "$req" &>/dev/null &&
buildreq="$(rpm -q --qf %{name} --whatprovides "$req")" || buildreq="$(rpm -q --qf "%{name}\n" --whatprovides "$req"|head -n1)" ||
echo "#$req: unidentified build requirement" echo "#$req: unidentified build requirement"
else else
# other requirements probably coming from static 'Requires:' # other requirements probably coming from static 'Requires:'