From 89ffd15e4f9c2199b51f3f0ca642bcb87c82b0e1 Mon Sep 17 00:00:00 2001 From: Alexandre Eher Date: Wed, 25 Sep 2019 01:02:17 +0200 Subject: [PATCH] Use GNU sed for OSX OSX already come with a version of sed that is incompatible with the GNU sed from Linux. We can install same version used by Linux so the commands will be compatible. Signed-off-by: Alexandre Eher --- .travis.yml | 10 ++++++---- bin/list-all | 11 ++++++++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4747ee2..a406b7e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,11 +5,13 @@ before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew outdated jpeg || brew upgrade jpeg; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew outdated openssl || brew upgrade openssl; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew outdated readline || brew upgrade readline; fi -- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install freetype bison bison27 gettext icu4c libiconv libpng - zlib curl; fi +- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install freetype bison bison27 gettext icu4c + libiconv libpng zlib curl gnu-sed; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PKG_CONFIG_PATH='/usr/local/opt/openssl/lib/pkgconfig'; fi -- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PHP_CONFIGURE_OPTIONS='--with-iconv=$(brew --prefix libiconv) --with-openssl=$(brew --prefix openssl)'; fi -- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH="$(brew --prefix bison)/bin:$(brew --prefix icu4c)/bin:$(brew --prefix icu4c)/sbin:$PATH:$(brew --prefix curl)/bin"; fi +- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PHP_CONFIGURE_OPTIONS='--with-iconv=$(brew --prefix libiconv) + --with-openssl=$(brew --prefix openssl)'; fi +- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH="$(brew --prefix bison)/bin:$(brew + --prefix icu4c)/bin:$(brew --prefix icu4c)/sbin:$PATH:$(brew --prefix curl)/bin"; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -qq; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install curl build-essential autoconf libjpeg-dev libpng12-dev openssl libssl-dev libcurl4-openssl-dev pkg-config diff --git a/bin/list-all b/bin/list-all index 909632b..56e2f96 100755 --- a/bin/list-all +++ b/bin/list-all @@ -5,12 +5,17 @@ if [ -n "$GITHUB_API_TOKEN" ]; then auth="-H 'Authorization: token $GITHUB_API_TOKEN'" fi +sed="sed" +if hash gsed 2>/dev/null; then + sed="gsed" +fi + versions=$(curl $auth -s https://api.github.com/repos/php/php-src/git/refs/tags | # Fetch all tags grep '"ref":' | # Filter by refs grep 'php-' | # Filter only those related to php-xxxx - sed 's/\"ref\"://' | # Remove '"ref":' - sed 's/\"refs\/tags\/php-//' | # Remove '"refs/tags/php-"' - sed 's/\",//') # Remove last '",' + $sed 's/\"ref\"://' | # Remove '"ref":' + $sed 's/\"refs\/tags\/php-//' | # Remove '"refs/tags/php-"' + $sed 's/\",//') # Remove last '",' # As per the documentation, all versions should be in a single line separated # by spaces. We use `xargs` for this.