From 009246e96ad142afcfe15cc277cfdf6679890520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 8 Jan 2018 18:00:41 +0100 Subject: [PATCH] Force PHP platform in composer to oldest supported version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This way the packages should be compatible with all versions we support regardless PHP version used to build the release. Fixes #13831 Signed-off-by: Michal Čihař --- scripts/create-release.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/create-release.sh b/scripts/create-release.sh index e8f1d5aa9c..c2f8707620 100755 --- a/scripts/create-release.sh +++ b/scripts/create-release.sh @@ -220,12 +220,18 @@ rm -f .travis.yml .coveralls.yml .scrutinizer.yml .jshintrc .weblate codecov.yml rm -f README.rst if [ ! -d libraries/tcpdf ] ; then - echo "* Running composer" - composer update --no-dev + PHP_REQ=`sed -n '/"php"/ s/.*">=\([0-9]\.[0-9]\).*/\1/p' composer.json` + if [ -z "$PHP_REQ" ] ; then + echo "Failed to figure out required PHP version from composer.json" + exit 2 + fi # Okay, there is no way to tell composer to install # suggested package. Let's require it and then revert # composer.json to original state. cp composer.json composer.json.backup + echo "* Running composer" + composer config platform.php "$PHP_REQ" + composer update --no-dev composer require --update-no-dev tecnickcom/tcpdf mv composer.json.backup composer.json echo "* Cleanup of composer packages"