From 082108d4c8055b0652b209e330748eb3f1364424 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 29 Apr 2020 10:33:52 +0200 Subject: update to 5.2.2 fix test suite for PHP 7.4 using patch from https://github.com/llaville/php-compat-info/pull/261 --- 261.patch | 22 +++++++++ php-bartlett-PHP-CompatInfo-5.2.1-rpm.patch | 75 ----------------------------- php-bartlett-PHP-CompatInfo-5.2.2-rpm.patch | 75 +++++++++++++++++++++++++++++ php-bartlett-PHP-CompatInfo.spec | 17 +++++-- 4 files changed, 109 insertions(+), 80 deletions(-) create mode 100644 261.patch delete mode 100644 php-bartlett-PHP-CompatInfo-5.2.1-rpm.patch create mode 100644 php-bartlett-PHP-CompatInfo-5.2.2-rpm.patch diff --git a/261.patch b/261.patch new file mode 100644 index 0000000..a85df82 --- /dev/null +++ b/261.patch @@ -0,0 +1,22 @@ +From 19098e5772eb4ad87cdc2ebcb94b3fdca39c0887 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Wed, 29 Apr 2020 10:25:46 +0200 +Subject: [PATCH] fix curly braces is deprecated + +--- + src/Bartlett/CompatInfo/Sniffs/PHP/DocStringSyntaxSniff.php | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/Bartlett/CompatInfo/Sniffs/PHP/DocStringSyntaxSniff.php b/src/Bartlett/CompatInfo/Sniffs/PHP/DocStringSyntaxSniff.php +index ec0e33a6..dc1e31ad 100644 +--- a/src/Bartlett/CompatInfo/Sniffs/PHP/DocStringSyntaxSniff.php ++++ b/src/Bartlett/CompatInfo/Sniffs/PHP/DocStringSyntaxSniff.php +@@ -100,7 +100,7 @@ protected function isHeredocSyntax($node) + { + $i = $node->getAttribute('startTokenPos'); + return (strpos($this->tokens[$i][1], "<<<") === 0 +- && $this->tokens[$i][1]{3} !== "'" ++ && $this->tokens[$i][1][3] !== "'" + ); + } + diff --git a/php-bartlett-PHP-CompatInfo-5.2.1-rpm.patch b/php-bartlett-PHP-CompatInfo-5.2.1-rpm.patch deleted file mode 100644 index e7ed3f5..0000000 --- a/php-bartlett-PHP-CompatInfo-5.2.1-rpm.patch +++ /dev/null @@ -1,75 +0,0 @@ -diff -up ./bin/phpcompatinfo.json.dist.rpm ./bin/phpcompatinfo.json.dist ---- ./bin/phpcompatinfo.json.dist.rpm 2018-11-27 22:03:39.000000000 +0100 -+++ ./bin/phpcompatinfo.json.dist 2018-11-28 08:53:47.258278539 +0100 -@@ -6,6 +6,19 @@ - } - ], - "plugins": [ -+ { -+ "name": "Cache", -+ "class": "Bartlett\\Reflect\\Plugin\\CachePlugin", -+ "options": { -+ "adapter": "DoctrineCacheAdapter", -+ "backend": { -+ "class": "Doctrine\\Common\\Cache\\FilesystemCache", -+ "args": [ -+ "%{HOME}/.cache/php-reflect" -+ ] -+ } -+ } -+ } - ], - "analysers" : [ - ], -diff -up ./bin/phpcompatinfo.rpm ./bin/phpcompatinfo ---- ./bin/phpcompatinfo.rpm 2018-11-28 08:53:47.258278539 +0100 -+++ ./bin/phpcompatinfo 2018-11-28 08:55:38.807878501 +0100 -@@ -1,42 +1,22 @@ - #!/usr/bin/env php - setUseIncludePath(true); - - if (PHP_SAPI !== 'cli') { - return; - } - --$compatInfoDbV1 = class_exists(Bartlett\CompatInfoDb\Environment::class); -- --if (\Phar::running() && $compatInfoDbV1) { -- try { -- Bartlett\CompatInfoDb\Environment::checkRequirements(); -- } catch (\RuntimeException $e) { -- die ($e->getMessage()); -- } --} -- - use Bartlett\Reflect\Environment; - use Bartlett\CompatInfo\Console\Application; - - Environment::setScanDir(); - --$application = new Application($appName, '5.2.1'); -+$application = new Application($appName, '@package_version@'); - $application->run(); diff --git a/php-bartlett-PHP-CompatInfo-5.2.2-rpm.patch b/php-bartlett-PHP-CompatInfo-5.2.2-rpm.patch new file mode 100644 index 0000000..2c9d19d --- /dev/null +++ b/php-bartlett-PHP-CompatInfo-5.2.2-rpm.patch @@ -0,0 +1,75 @@ +diff -up ./bin/phpcompatinfo.json.dist.rpm ./bin/phpcompatinfo.json.dist +--- ./bin/phpcompatinfo.json.dist.rpm 2018-11-27 22:03:39.000000000 +0100 ++++ ./bin/phpcompatinfo.json.dist 2018-11-28 08:53:47.258278539 +0100 +@@ -6,6 +6,19 @@ + } + ], + "plugins": [ ++ { ++ "name": "Cache", ++ "class": "Bartlett\\Reflect\\Plugin\\CachePlugin", ++ "options": { ++ "adapter": "DoctrineCacheAdapter", ++ "backend": { ++ "class": "Doctrine\\Common\\Cache\\FilesystemCache", ++ "args": [ ++ "%{HOME}/.cache/php-reflect" ++ ] ++ } ++ } ++ } + ], + "analysers" : [ + ], +diff -up ./bin/phpcompatinfo.rpm ./bin/phpcompatinfo +--- ./bin/phpcompatinfo.rpm 2018-11-28 08:53:47.258278539 +0100 ++++ ./bin/phpcompatinfo 2018-11-28 08:55:38.807878501 +0100 +@@ -1,42 +1,22 @@ + #!/usr/bin/env php + setUseIncludePath(true); + + if (PHP_SAPI !== 'cli') { + return; + } + +-$compatInfoDbV1 = class_exists(Bartlett\CompatInfoDb\Environment::class); +- +-if (\Phar::running() && $compatInfoDbV1) { +- try { +- Bartlett\CompatInfoDb\Environment::checkRequirements(); +- } catch (\RuntimeException $e) { +- die ($e->getMessage()); +- } +-} +- + use Bartlett\Reflect\Environment; + use Bartlett\CompatInfo\Console\Application; + + Environment::setScanDir(); + +-$application = new Application($appName, '5.2.2'); ++$application = new Application($appName, '@package_version@'); + $application->run(); diff --git a/php-bartlett-PHP-CompatInfo.spec b/php-bartlett-PHP-CompatInfo.spec index 4325ee6..5ccfaa0 100644 --- a/php-bartlett-PHP-CompatInfo.spec +++ b/php-bartlett-PHP-CompatInfo.spec @@ -11,7 +11,7 @@ %undefine __brp_mangle_shebangs %{!?php_version: %global php_version %(php -r 'echo PHP_VERSION;' 2>/dev/null)} -%global gh_commit 287d879f1b85f49faffdca89088a6b7bffb535d9 +%global gh_commit de5add0eae4774e5832259ebef3f6223ca23a5e1 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) #global gh_date 20151005 %global gh_owner llaville @@ -26,7 +26,7 @@ %endif Name: php-bartlett-PHP-CompatInfo -Version: 5.2.1 +Version: 5.2.2 %global specrel 1 Release: %{?gh_date:1%{specrel}.%{?prever}%{!?prever:%{gh_date}git%{gh_short}}}%{!?gh_date:%{specrel}}%{?dist} Summary: Find out version and the extensions required for a piece of code to run @@ -42,7 +42,9 @@ Source1: fedora-review-check Source2: %{name}-5.1.0-autoload.php # Autoload and sqlite database path -Patch0: %{name}-5.2.1-rpm.patch +Patch0: %{name}-5.2.2-rpm.patch + +Patch1: https://patch-diff.githubusercontent.com/raw/llaville/php-compat-info/pull/261.patch BuildArch: noarch BuildRequires: php(language) >= 5.5 @@ -150,7 +152,7 @@ Documentation: http://php5.laurent-laville.org/compatinfo/manual/current/en/ %prep %setup -q -n %{gh_project}-%{gh_commit} -#setup -q -n %{gh_project}-%{version} +%patch1 -p1 %patch0 -p1 -b .rpm cp %{SOURCE2} src/Bartlett/CompatInfo/autoload.php @@ -185,7 +187,7 @@ ln -s %{buildroot}%{_datadir}/php/Bartlett/CompatInfo/autoload.php vendor/ ret=0 -for cmdarg in "php %{phpunit}" "php70 %{_bindir}/phpunit" php71 php72 php73 php74; do +for cmdarg in "php %{phpunit}" php72 php73 php74 php80; do if which $cmdarg; then set $cmdarg $1 ${2:-%{_bindir}/phpunit7} \ @@ -216,6 +218,11 @@ fi %changelog +* Wed Apr 29 2020 Remi Collet - 5.2.2-1 +- update to 5.2.2 +- fix test suite for PHP 7.4 using patch from + https://github.com/llaville/php-compat-info/pull/261 + * Tue Oct 22 2019 Remi Collet - 5.2.1-1 - update to 5.2.1 (no change) -- cgit