Remove bc dependency

This commit is contained in:
the Sane 2022-01-07 14:22:59 -05:00 committed by GitHub
parent a328b465ef
commit 9909221dff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1148,11 +1148,13 @@ download_select_install() {
esac
# For runners, check GlibC version against runner requirements
if [ "download_type" = "runner" ] && [ "$contributor_name" = "/dev/null" ]; then
if [ "$download_type" = "runner" ] && [ "$contributor_name" = "/dev/null" ]; then
required_glibc="2.33"
system_glibc="$(ldd --version | awk '/ldd/{print $NF}')"
if [ "$(bc <<< "$required_glibc > $system_glibc")" = "1" ]; then
# Sort the versions and check if the installed glibc is smaller
if [ "$required_glibc" != "$system_glibc" ] &&
[ "$system_glibc" = "$(printf "$system_glibc\n$required_glibc" | sort -V | head -n1)" ]; then
message warning "Your glibc version is incompatible with the selected runner.\n\nSystem glibc: v$system_glibc\nMinimum required glibc: v$required_glibc"
return 1
fi