Merge pull request #7886 from zmstone/5.0-build-macos-do-not-depend-on-gsed

build(macos): do not depend on gsed
This commit is contained in:
Xinyu Liu 2022-05-07 21:49:49 +08:00 committed by GitHub
commit dc1cd3b34e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -10,8 +10,8 @@ UNAME="$(uname -s)"
case "$UNAME" in
Darwin)
DIST='macos'
VERSION_ID=$(sw_vers | gsed -n '/^ProductVersion:/p' | gsed -r 's/ProductVersion:(.*)/\1/g' | gsed -r 's/([0-9]+).*/\1/g' | gsed 's/^[ \t]*//g')
SYSTEM="$(echo "${DIST}${VERSION_ID}" | gsed -r 's/([a-zA-Z]*)-.*/\1/g')"
VERSION_ID="$(sw_vers | grep 'ProductVersion' | cut -d':' -f 2 | cut -d'.' -f1 | tr -d ' \t')"
SYSTEM="${DIST}${VERSION_ID}"
;;
Linux)
if grep -q -i 'rhel' /etc/*-release; then