From e6fc5d96bcaeaf3cc6f714cf30e71d08fbb7b23f Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 4 Jun 2019 19:15:39 +0200 Subject: - update to 4.3.2 - add php-phpmyadmin-sql-parser-tokenize-query command --- composer.json | 6 ++-- php-phpmyadmin-sql-parser-autoload.patch | 53 ++++++++++++++++++++++++++------ php-phpmyadmin-sql-parser.spec | 18 ++++++++--- 3 files changed, 61 insertions(+), 16 deletions(-) diff --git a/composer.json b/composer.json index d6e1c09..f4af964 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,8 @@ "require-dev": { "sami/sami": "^4.0", "phpunit/php-code-coverage": "*", - "phpunit/phpunit": "~4.8 || ~5.7 || ~6.5" + "phpunit/phpunit": "~4.8 || ~5.7 || ~6.5", + "squizlabs/php_codesniffer": "^2.9" }, "conflict": { "phpmyadmin/motranslator": "<3.0" @@ -33,7 +34,8 @@ }, "bin": [ "bin/highlight-query", - "bin/lint-query" + "bin/lint-query", + "bin/tokenize-query" ], "autoload": { "psr-4": { diff --git a/php-phpmyadmin-sql-parser-autoload.patch b/php-phpmyadmin-sql-parser-autoload.patch index 0772d08..3cea924 100644 --- a/php-phpmyadmin-sql-parser-autoload.patch +++ b/php-phpmyadmin-sql-parser-autoload.patch @@ -1,6 +1,6 @@ -diff -up bin/highlight-query.rpm bin/highlight-query ---- bin/highlight-query.rpm 2017-01-23 14:31:05.207518012 +0100 -+++ bin/highlight-query 2017-01-23 14:30:38.429411132 +0100 +diff -up ./bin/highlight-query.rpm ./bin/highlight-query +--- ./bin/highlight-query.rpm 2019-06-03 14:32:07.000000000 +0200 ++++ ./bin/highlight-query 2019-06-04 19:06:37.085484476 +0200 @@ -1,29 +1,7 @@ #!/usr/bin/env php runHighlight()); -diff -up bin/lint-query.rpm bin/lint-query ---- bin/lint-query.rpm 2017-01-23 14:29:14.954077962 +0100 -+++ bin/lint-query 2017-01-23 14:31:11.744544102 +0100 +diff -up ./bin/lint-query.rpm ./bin/lint-query +--- ./bin/lint-query.rpm 2019-06-03 14:32:07.000000000 +0200 ++++ ./bin/lint-query 2019-06-04 19:06:37.085484476 +0200 @@ -1,29 +1,7 @@ #!/usr/bin/env php runLint()); - -diff -up src/Translator.php.rpm src/Translator.php ---- src/Translator.php.rpm 2017-01-23 15:20:46.092415469 +0100 -+++ src/Translator.php 2017-01-23 15:21:01.738477917 +0100 +diff -up ./bin/tokenize-query.rpm ./bin/tokenize-query +--- ./bin/tokenize-query.rpm 2019-06-04 19:08:04.886758030 +0200 ++++ ./bin/tokenize-query 2019-06-04 19:08:09.025766484 +0200 +@@ -1,29 +1,7 @@ + #!/usr/bin/env php + runTokenize()); +diff -up ./src/Translator.php.rpm ./src/Translator.php +--- ./src/Translator.php.rpm 2019-06-03 14:32:07.000000000 +0200 ++++ ./src/Translator.php 2019-06-04 19:06:37.085484476 +0200 @@ -40,7 +40,7 @@ class Translator self::$loader->textdomain('sqlparser'); diff --git a/php-phpmyadmin-sql-parser.spec b/php-phpmyadmin-sql-parser.spec index 1db2212..bcc035a 100644 --- a/php-phpmyadmin-sql-parser.spec +++ b/php-phpmyadmin-sql-parser.spec @@ -7,7 +7,7 @@ # Please, preserve the changelog entries # -%global gh_commit 0eb16ef5e3acacbc792be336754e42d98791a33f +%global gh_commit b35c21f82e7202d739f6349a583b11e6d32b2b64 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner phpmyadmin #global gh_date 20150820 @@ -17,7 +17,7 @@ %global ns_project SqlParser Name: php-%{gh_owner}-%{gh_project} -Version: 4.3.1 +Version: 4.3.2 Release: 1%{?gh_date?%{gh_date}git%{gh_short}}%{?dist} Summary: A validating SQL lexer and parser with a focus on MySQL dialect @@ -36,7 +36,8 @@ BuildRequires: php-composer(phpmyadmin/motranslator) >= 3.0 BuildRequires: php-mbstring # For tests, from composer.json "require-dev": { # "phpunit/php-code-coverage": "*", -# "phpunit/phpunit": "~4.8 || ~5.7 || ~6.5" +# "phpunit/phpunit": "~4.8 || ~5.7 || ~6.5", +# "squizlabs/php_codesniffer": "^2.9" %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 BuildRequires: phpunit6 >= 6.5 %global phpunit %{_bindir}/phpunit6 @@ -121,6 +122,7 @@ cp -pr locale %{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}/locale : Commands install -Dpm 0755 bin/highlight-query %{buildroot}%{_bindir}/%{name}-highlight-query install -Dpm 0755 bin/lint-query %{buildroot}%{_bindir}/%{name}-lint-query +install -Dpm 0755 bin/tokenize-query %{buildroot}%{_bindir}/%{name}-tokenize-query %if 0%{?fedora} >= 12 || 0%{?rhel} >= 7 %find_lang sqlparser @@ -136,8 +138,11 @@ require '%{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}/autoload.php'; \Fedora\Autoloader\Autoload::addPsr4('%{ns_vendor}\\%{ns_project}\\Tests\\', dirname(__DIR__).'/tests'); EOF +: fix commands +sed -e 's:%{_datadir}/php:%{buildroot}%{_datadir}/php:' -i bin/*query + ret=0 -for cmdarg in "php %{phpunit}" php70 php71 php72 php73; do +for cmdarg in "php %{phpunit}" php71 php72 php73 php74; do if which $cmdarg; then set $cmdarg $1 ${2:-%{_bindir}/phpunit6} --no-coverage --verbose || ret=1 @@ -161,6 +166,7 @@ exit $ret %doc README.md %{_bindir}/%{name}-highlight-query %{_bindir}/%{name}-lint-query +%{_bindir}/%{name}-tokenize-query %dir %{_datadir}/php/%{ns_vendor}/%{ns_project} %{_datadir}/php/%{ns_vendor}/%{ns_project}/*php %{_datadir}/php/%{ns_vendor}/%{ns_project}/Components/ @@ -174,6 +180,10 @@ exit $ret %changelog +* Tue Jun 4 2019 Remi Collet - 4.3.2-1 +- update to 4.3.2 +- add php-phpmyadmin-sql-parser-tokenize-query command + * Sun Jan 6 2019 Remi Collet - 4.3.1-1 - update to 4.3.1 -- cgit