Reduce sed usage

This commit is contained in:
Taiki Endo
2026-04-15 21:24:40 +09:00
parent 6fc852a7b2
commit 2ed84e4b1e
2 changed files with 4 additions and 2 deletions

View File

@@ -464,7 +464,8 @@ case "$(uname -s)" in
host_env=musl
else
host_env=gnu
host_glibc_version=$(grep -E "GLIBC|GNU libc" <<<"${ldd_version}" | sed -E "s/.* //g")
host_glibc_version=$(grep -E "GLIBC|GNU libc" <<<"${ldd_version}")
host_glibc_version="${host_glibc_version##* }"
fi
if [[ -e /etc/redhat-release ]]; then
# /etc/os-release is available on RHEL/CentOS 7+

View File

@@ -72,7 +72,8 @@ case "$(uname -s)" in
if [[ "${ldd_version}" == *'musl'* ]]; then
incompat_tools+=("${musl_incompat[@]}")
else
host_glibc_version=$(grep -E "GLIBC|GNU libc" <<<"${ldd_version}" | sed "s/.* //g")
host_glibc_version=$(grep -E "GLIBC|GNU libc" <<<"${ldd_version}")
host_glibc_version="${host_glibc_version##* }"
higher_glibc_version=$(LC_ALL=C sort -Vu <<<"2.39"$'\n'"${host_glibc_version}" | tail -1)
if [[ "${higher_glibc_version}" != "${host_glibc_version}" ]]; then
higher_glibc_version=$(LC_ALL=C sort -Vu <<<"2.35"$'\n'"${host_glibc_version}" | tail -1)