diff options
-rw-r--r-- | composer.json | 12 | ||||
-rw-r--r-- | php-phpmyadmin-sql-parser5-autoload.patch | 32 | ||||
-rw-r--r-- | php-phpmyadmin-sql-parser5-php74.patch | 35 | ||||
-rw-r--r-- | php-phpmyadmin-sql-parser5.spec | 36 |
4 files changed, 50 insertions, 65 deletions
diff --git a/composer.json b/composer.json index c525411..51a13f6 100644 --- a/composer.json +++ b/composer.json @@ -20,10 +20,13 @@ "symfony/polyfill-mbstring": "^1.3" }, "require-dev": { - "sami/sami": "^4.0", + "phpmyadmin/coding-standard": "^1.0", + "phpmyadmin/motranslator": "^4.0", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12.3", + "phpstan/phpstan-phpunit": "^0.12.1", "phpunit/php-code-coverage": "*", - "phpunit/phpunit": "^7.4", - "phpmyadmin/coding-standard": "^1.0" + "phpunit/phpunit": "^7.4 || ^8" }, "conflict": { "phpmyadmin/motranslator": "<3.0" @@ -46,5 +49,8 @@ "psr-4": { "PhpMyAdmin\\SqlParser\\Tests\\": "tests" } + }, + "config":{ + "sort-packages": true } } diff --git a/php-phpmyadmin-sql-parser5-autoload.patch b/php-phpmyadmin-sql-parser5-autoload.patch index e36b353..34a6030 100644 --- a/php-phpmyadmin-sql-parser5-autoload.patch +++ b/php-phpmyadmin-sql-parser5-autoload.patch @@ -1,16 +1,16 @@ diff -up ./bin/highlight-query.rpm ./bin/highlight-query ---- ./bin/highlight-query.rpm 2019-09-02 14:54:16.417436515 +0200 -+++ ./bin/highlight-query 2019-09-02 14:55:10.825758789 +0200 +--- ./bin/highlight-query.rpm 2020-01-08 07:34:11.970216276 +0100 ++++ ./bin/highlight-query 2020-01-08 07:35:49.464106360 +0100 @@ -2,29 +2,7 @@ <?php declare(strict_types=1); --$files = array( +-$files = [ - __DIR__ . "/../vendor/autoload.php", - __DIR__ . "/../../vendor/autoload.php", - __DIR__ . "/../../../autoload.php", - "vendor/autoload.php" --); +-]; - -$found = false; -foreach ($files as $file) { @@ -33,18 +33,18 @@ diff -up ./bin/highlight-query.rpm ./bin/highlight-query $cli = new PhpMyAdmin\SqlParser\Utils\CLI(); exit($cli->runHighlight()); diff -up ./bin/lint-query.rpm ./bin/lint-query ---- ./bin/lint-query.rpm 2019-09-02 14:54:16.417436515 +0200 -+++ ./bin/lint-query 2019-09-02 14:55:18.682805327 +0200 +--- ./bin/lint-query.rpm 2020-01-08 07:34:11.970216276 +0100 ++++ ./bin/lint-query 2020-01-08 07:36:02.913951007 +0100 @@ -2,29 +2,7 @@ <?php declare(strict_types=1); --$files = array( +-$files = [ - __DIR__ . "/../vendor/autoload.php", - __DIR__ . "/../../vendor/autoload.php", - __DIR__ . "/../../../autoload.php", - "vendor/autoload.php" --); +-]; - -$found = false; -foreach ($files as $file) { @@ -67,18 +67,18 @@ diff -up ./bin/lint-query.rpm ./bin/lint-query $cli = new PhpMyAdmin\SqlParser\Utils\CLI(); exit($cli->runLint()); diff -up ./bin/tokenize-query.rpm ./bin/tokenize-query ---- ./bin/tokenize-query.rpm 2019-09-02 14:54:16.418436521 +0200 -+++ ./bin/tokenize-query 2019-09-02 14:55:29.169867441 +0200 +--- ./bin/tokenize-query.rpm 2020-01-08 07:34:11.970216276 +0100 ++++ ./bin/tokenize-query 2020-01-08 07:36:16.233799679 +0100 @@ -2,29 +2,7 @@ <?php declare(strict_types=1); --$files = array( +-$files = [ - __DIR__ . "/../vendor/autoload.php", - __DIR__ . "/../../vendor/autoload.php", - __DIR__ . "/../../../autoload.php", - "vendor/autoload.php" --); +-]; - -$found = false; -foreach ($files as $file) { @@ -101,9 +101,9 @@ diff -up ./bin/tokenize-query.rpm ./bin/tokenize-query $cli = new PhpMyAdmin\SqlParser\Utils\CLI(); exit($cli->runTokenize()); diff -up ./src/Translator.php.rpm ./src/Translator.php ---- ./src/Translator.php.rpm 2019-05-10 02:57:14.000000000 +0200 -+++ ./src/Translator.php 2019-09-02 14:54:16.418436521 +0200 -@@ -40,7 +40,7 @@ class Translator +--- ./src/Translator.php.rpm 2020-01-08 07:34:11.970216276 +0100 ++++ ./src/Translator.php 2020-01-08 07:37:02.060280464 +0100 +@@ -42,7 +42,7 @@ class Translator self::$loader->textdomain('sqlparser'); // Set path where to look for a domain @@ -111,4 +111,4 @@ diff -up ./src/Translator.php.rpm ./src/Translator.php + self::$loader->bindtextdomain('sqlparser', __DIR__ . '/locale/'); } - if (is_null(self::$translator)) { + if (self::$translator === null) { diff --git a/php-phpmyadmin-sql-parser5-php74.patch b/php-phpmyadmin-sql-parser5-php74.patch deleted file mode 100644 index ba6220a..0000000 --- a/php-phpmyadmin-sql-parser5-php74.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 579f7445f7cfd8c3ff07f20fe836a1c56518656e Mon Sep 17 00:00:00 2001 -From: Remi Collet <remi@remirepo.net> -Date: Mon, 2 Sep 2019 15:02:02 +0200 -Subject: [PATCH] fix implode arg. order - ---- - src/Components/Expression.php | 2 +- - src/Components/ExpressionArray.php | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/Components/Expression.php b/src/Components/Expression.php -index 9c21def5..108f3350 100644 ---- a/src/Components/Expression.php -+++ b/src/Components/Expression.php -@@ -433,7 +433,7 @@ public static function parse(Parser $parser, TokensList $list, array $options = - public static function build($component, array $options = []) - { - if (is_array($component)) { -- return implode($component, ', '); -+ return implode(', ', $component); - } - - if ($component->expr !== '' && ! is_null($component->expr)) { -diff --git a/src/Components/ExpressionArray.php b/src/Components/ExpressionArray.php -index 2f44d7af..eb05aac9 100644 ---- a/src/Components/ExpressionArray.php -+++ b/src/Components/ExpressionArray.php -@@ -122,6 +122,6 @@ public static function build($component, array $options = []) - $ret[] = $frag::build($frag); - } - -- return implode($ret, ', '); -+ return implode(', ', $ret); - } - } diff --git a/php-phpmyadmin-sql-parser5.spec b/php-phpmyadmin-sql-parser5.spec index cece3a2..1dfb906 100644 --- a/php-phpmyadmin-sql-parser5.spec +++ b/php-phpmyadmin-sql-parser5.spec @@ -1,13 +1,13 @@ # remirepo/fedora spec file for php-phpmyadmin-sql-parser5 # -# Copyright (c) 2015-2019 Remi Collet +# Copyright (c) 2015-2020 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries # -%global gh_commit 538611d5336e1bd8aea30744dab43289334f1657 +%global gh_commit bddaf056f8f43621e94b29284c98f35db8b6d93e %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner phpmyadmin #global gh_date 20150820 @@ -18,8 +18,8 @@ %global major 5 Name: php-%{gh_owner}-%{gh_project}%{major} -Version: 5.0.0 -Release: 2%{?gh_date?%{gh_date}git%{gh_short}}%{?dist} +Version: 5.2.0 +Release: 1%{?gh_date?%{gh_date}git%{gh_short}}%{?dist} Summary: A validating SQL lexer and parser with a focus on MySQL dialect License: GPLv2+ @@ -28,8 +28,6 @@ Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit # Use our autoloader and locale relocation Patch0: %{name}-autoload.patch -# PHP 7.4 -Patch1: %{name}-php74.patch BuildArch: noarch BuildRequires: gettext @@ -39,12 +37,21 @@ BuildRequires: php-composer(phpmyadmin/motranslator) >= 3.0 BuildRequires: php-mbstring BuildRequires: php-spl # For tests, from composer.json "require-dev": { +# "phpmyadmin/coding-standard": "^1.0", +# "phpmyadmin/motranslator": "^4.0", +# "phpstan/extension-installer": "^1.0", +# "phpstan/phpstan": "^0.12.3", +# "phpstan/phpstan-phpunit": "^0.12.1", # "phpunit/php-code-coverage": "*", -# "phpunit/phpunit": "^7.4", -# "phpmyadmin/coding-standard": "^1.0" +# "phpunit/phpunit": "^7.4 || ^8" +%if 0%{?fedora} >= 29 || 0%{?rhel} >= 8 +BuildRequires: phpunit8 +%global phpunit %{_bindir}/phpunit8 +%else BuildRequires: phpunit7 >= 7.4 %global phpunit %{_bindir}/phpunit7 %endif +%endif # For autoloader BuildRequires: php-composer(fedora/autoloader) @@ -84,7 +91,6 @@ Autoloader: %{_datadir}/php/%{ns_vendor}/%{ns_project}%{major}/autoload.php %setup -q -n %{gh_project}-%{gh_commit} %patch0 -p0 -b .rpm -%patch1 -p1 find src -name \*rpm -exec rm {} \; : Create autoloader @@ -140,10 +146,10 @@ EOF sed -e 's:%{_datadir}/php:%{buildroot}%{_datadir}/php:' -i bin/*query ret=0 -for cmdarg in "php %{phpunit}" php71 php72 php73 php74; do +for cmdarg in "php %{phpunit}" "php71 %{_bindir}/phpunit7" php72 php73 php74; do if which $cmdarg; then set $cmdarg - $1 ${2:-%{_bindir}/phpunit7} --no-coverage --verbose || ret=1 + $1 ${2:-%{_bindir}/phpunit8} --no-coverage --verbose || ret=1 fi done exit $ret @@ -180,6 +186,14 @@ exit $ret %changelog +* Wed Jan 8 2020 Remi Collet <remi@remirepo.net> - 5.2.0-1 +- update to 5.2.0 + +* Tue Nov 12 2019 Remi Collet <remi@remirepo.net> - 5.1.0-1 +- update to 5.1.0 +- drop patch merged upstream +- use phpunit8 + * Thu Sep 19 2019 Remi Collet <remi@remirepo.net> - 5.0.0-2 - rename patch, use local copy instead of remote URI |