From a92641b02bcfb57386ab756418da73f149703593 Mon Sep 17 00:00:00 2001 From: Tahina Ramananandro Date: Sun, 9 Apr 2023 17:07:50 -0700 Subject: [PATCH] install and use GNU sed (`gsed`) on MacOS --- .github/setup-macos.sh | 2 +- .scripts/publish_release.sh | 3 ++- .scripts/release.sh | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/setup-macos.sh b/.github/setup-macos.sh index b1baad5ea55..13b60edbd7f 100755 --- a/.github/setup-macos.sh +++ b/.github/setup-macos.sh @@ -3,7 +3,7 @@ # Install OCaml and other GNU build tools # coreutils: for the `install` command used in install-ulib.sh export OPAMYES=1 -brew install opam bash gnu-getopt coreutils +brew install opam bash gnu-getopt coreutils gnu-sed opam init --compiler=4.12.0 eval $(opam env) diff --git a/.scripts/publish_release.sh b/.scripts/publish_release.sh index ebdff2a25df..77d1703123e 100755 --- a/.scripts/publish_release.sh +++ b/.scripts/publish_release.sh @@ -16,7 +16,8 @@ pushd "$FSTAR_HOST_HOME" echo "*** Rename package ***" dev='~dev' -CURRENT_VERSION=$(cat version.txt | sed 's!'"$dev"'!!' | sed 's!'"\r"'$!!') +SED=$(which gsed >/dev/null 2>&1 && echo gsed || echo sed) +CURRENT_VERSION=$(cat version.txt | $SED 's!'"$dev"'!!' | $SED 's!'"\r"'$!!') my_tag="v$CURRENT_VERSION" if [[ -z $OS ]] ; then OS=$(uname) diff --git a/.scripts/release.sh b/.scripts/release.sh index cd844bdbdc3..71d9f04971b 100755 --- a/.scripts/release.sh +++ b/.scripts/release.sh @@ -24,8 +24,9 @@ fi cd "$FSTAR_HOST_HOME" # Strip the ~dev part of the version number +SED=$(which gsed >/dev/null 2>&1 && echo gsed || echo sed) dev='~dev' -sed -i 's!'"$dev"'!!' version.txt +$SED -i 's!'"$dev"'!!' version.txt # Build the package if [[ -z "$CI_THREADS" ]] ; then