mirror of
https://github.com/taiki-e/install-action.git
synced 2026-04-21 07:00:27 +00:00
Reduce sed usage
This commit is contained in:
3
main.sh
3
main.sh
@@ -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+
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user