Fix case when there are more than one matching libraries (#8955)

Small fix to the script for the scenario where more than one matching
library can be returned.
For example, the command `/sbin/ldconfig -p | grep libstdc++ | awk '{
print $NF }'` can result in

```
/lib/x86_64-linux-gnu/libstdc++.so.6
/lib32/libstdc++.so.6
```

which then fails the check `if [[ ! -L "$link_path" ]]`
This commit is contained in:
Jacek Glen 2023-12-12 08:50:37 +01:00 committed by GitHub
parent 24987878e4
commit 4217f78368
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,7 +12,7 @@ function glibc_version {
}
function glibcpp_version {
link_path=$(/sbin/ldconfig -p | grep libstdc++ | awk '{ print $NF }')
link_path=$(/sbin/ldconfig -p | grep libstdc++ | awk '{ print $NF }' | head -1)
if [[ ! -L "$link_path" ]]
then
echo "0"