summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-04-20 08:31:34 +0200
committerRemi Collet <fedora@famillecollet.com>2016-04-20 08:31:34 +0200
commiteb4fad5bcb4613f19b32d621372b5c019cec0842 (patch)
treeedb2814976dc9c4be390c4100e3d3bc494634714
parentdd538baca37b1d5f5041ef0dbc6663ca676f60bd (diff)
php-nikic-php-parser: 2.1.0
-rw-r--r--composer.json2
-rw-r--r--php-nikic-php-parser-pr268.patch22
-rw-r--r--php-nikic-php-parser-pr269.patch32
-rw-r--r--php-nikic-php-parser-rpm.patch14
-rw-r--r--php-nikic-php-parser.spec22
5 files changed, 18 insertions, 74 deletions
diff --git a/composer.json b/composer.json
index e494f43..080d76a 100644
--- a/composer.json
+++ b/composer.json
@@ -24,7 +24,7 @@
"bin": ["bin/php-parse"],
"extra": {
"branch-alias": {
- "dev-master": "2.0-dev"
+ "dev-master": "2.1-dev"
}
}
}
diff --git a/php-nikic-php-parser-pr268.patch b/php-nikic-php-parser-pr268.patch
deleted file mode 100644
index edca1d9..0000000
--- a/php-nikic-php-parser-pr268.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From 352125814fe223a18f89510b55989c36f92f4ee0 Mon Sep 17 00:00:00 2001
-From: Remi Collet <fedora@famillecollet.com>
-Date: Fri, 15 Apr 2016 13:53:04 +0200
-Subject: [PATCH] make autoloader more PSR-4
-
----
- lib/PhpParser/Autoloader.php | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/PhpParser/Autoloader.php b/lib/PhpParser/Autoloader.php
-index 560a8d9..809a06e 100644
---- a/lib/PhpParser/Autoloader.php
-+++ b/lib/PhpParser/Autoloader.php
-@@ -31,7 +31,7 @@ static public function register($prepend = false) {
- */
- static public function autoload($class) {
- if (0 === strpos($class, 'PhpParser\\')) {
-- $fileName = dirname(__DIR__) . '/' . strtr($class, '\\', '/') . '.php';
-+ $fileName = __DIR__ . strtr(substr($class, 9), '\\', '/') . '.php';
- if (file_exists($fileName)) {
- require $fileName;
- }
diff --git a/php-nikic-php-parser-pr269.patch b/php-nikic-php-parser-pr269.patch
deleted file mode 100644
index 03bc429..0000000
--- a/php-nikic-php-parser-pr269.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 7fe074c38c7e7d5359e92d8ed43ed3a5cdf65266 Mon Sep 17 00:00:00 2001
-From: Remi Collet <fedora@famillecollet.com>
-Date: Fri, 15 Apr 2016 13:58:42 +0200
-Subject: [PATCH] support -h and --help standard options
-
----
- bin/php-parse | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/bin/php-parse b/bin/php-parse
-index db6c411..f6ce166 100755
---- a/bin/php-parse
-+++ b/bin/php-parse
-@@ -101,6 +101,7 @@ Operations is a list of the following options (--dump by default):
- --var-dump var_dump() nodes (for exact structure)
- -N, --resolve-names Resolve names using NodeVisitor\NameResolver
- -c, --with-column-info Show column-numbers for errors (if available)
-+ -h, --help Display this page
-
- Example:
- php-parse -d -p -N -d file.php
-@@ -150,6 +151,10 @@ function parseArgs($args) {
- case '-c';
- $attributes['with-column-info'] = true;
- break;
-+ case '--help':
-+ case '-h';
-+ showHelp('');
-+ break;
- case '--':
- $parseOptions = false;
- break;
diff --git a/php-nikic-php-parser-rpm.patch b/php-nikic-php-parser-rpm.patch
index d8bc078..df76983 100644
--- a/php-nikic-php-parser-rpm.patch
+++ b/php-nikic-php-parser-rpm.patch
@@ -1,6 +1,6 @@
diff -up ./bin/php-parse.rpm ./bin/php-parse
---- ./bin/php-parse.rpm 2016-02-28 20:48:28.000000000 +0100
-+++ ./bin/php-parse 2016-04-15 13:26:30.804687996 +0200
+--- ./bin/php-parse.rpm 2016-04-19 15:41:41.000000000 +0200
++++ ./bin/php-parse 2016-04-20 06:33:22.712063600 +0200
@@ -1,12 +1,7 @@
#!/usr/bin/env php
<?php
@@ -16,8 +16,8 @@ diff -up ./bin/php-parse.rpm ./bin/php-parse
ini_set('xdebug.max_nesting_level', 3000);
diff -up ./lib/bootstrap.php.rpm ./lib/bootstrap.php
---- ./lib/bootstrap.php.rpm 2016-02-28 20:48:28.000000000 +0100
-+++ ./lib/bootstrap.php 2016-04-15 13:26:30.804687996 +0200
+--- ./lib/bootstrap.php.rpm 2016-04-19 15:41:41.000000000 +0200
++++ ./lib/bootstrap.php 2016-04-20 06:33:22.712063600 +0200
@@ -1,6 +1,6 @@
<?php
@@ -27,8 +27,8 @@ diff -up ./lib/bootstrap.php.rpm ./lib/bootstrap.php
}
PhpParser\Autoloader::register();
diff -up ./test/bootstrap.php.rpm ./test/bootstrap.php
---- ./test/bootstrap.php.rpm 2016-02-28 20:48:28.000000000 +0100
-+++ ./test/bootstrap.php 2016-04-15 13:26:31.454690830 +0200
+--- ./test/bootstrap.php.rpm 2016-04-20 06:33:22.713063604 +0200
++++ ./test/bootstrap.php 2016-04-20 06:34:38.963385593 +0200
@@ -2,7 +2,7 @@
namespace PhpParser;
@@ -37,4 +37,4 @@ diff -up ./test/bootstrap.php.rpm ./test/bootstrap.php
+require '@BUILDROOT@/usr/share/php/PhpParser2/autoload.php';
function canonicalize($str) {
- // trim from both sides
+ // normalize EOL style
diff --git a/php-nikic-php-parser.spec b/php-nikic-php-parser.spec
index 270578b..8382915 100644
--- a/php-nikic-php-parser.spec
+++ b/php-nikic-php-parser.spec
@@ -6,7 +6,7 @@
#
# Please, preserve the changelog entries
#
-%global gh_commit ce5be709d59b32dd8a88c80259028759991a4206
+%global gh_commit 47b254ea51f1d6d5dc04b9b299e88346bf2369e3
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner nikic
%global gh_project PHP-Parser
@@ -17,7 +17,7 @@
%global eolv1 0
Name: php-%{gh_owner}-%{pk_project}
-Version: 2.0.1
+Version: 2.1.0
Release: 1%{?dist}
Summary: A PHP parser written in PHP
@@ -28,10 +28,6 @@ Source: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit
# Autoloader
Patch0: %{name}-rpm.patch
-# https://github.com/nikic/PHP-Parser/pull/268 - PSR-4 autoloader
-Patch1: %{name}-pr268.patch
-# https://github.com/nikic/PHP-Parser/pull/269 - --help option
-Patch2: %{name}-pr269.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -87,11 +83,6 @@ Autoloader: %{php_home}/PhpParser2/autoload.php
%setup -q -n %{gh_project}-%{gh_commit}
%patch0 -p1 -b .rpm
-%patch1 -p1 -b .pr268
-%patch2 -p1 -b .pr269
-
-: Cleanup to not install backup files
-find lib/PhpParser -name \*.pr268 -exec rm {} \; -print
%build
@@ -114,6 +105,9 @@ install -Dpm 0755 bin/php-parse %{buildroot}%{_bindir}/php-parse
%check
%if %{with_tests}
+# See https://github.com/nikic/PHP-Parser/issues/271
+sed -e '\:^//:d' -i test/code/parser/expr/new.test
+
: Test the command
sed -e 's:%{php_home}:%{buildroot}%{php_home}:' \
bin/php-parse > bin/php-parse-test
@@ -152,7 +146,11 @@ rm -rf %{buildroot}
%changelog
-* Fri Apr 15 2016 Remi Collet <remi@fedoraproject.org> - 2.0.0-1
+* Wed Apr 20 2016 Remi Collet <remi@fedoraproject.org> - 2.1.0-1
+- initial package, version 2.1.0
+- drop patches merged upstream
+
+* Fri Apr 15 2016 Remi Collet <remi@fedoraproject.org> - 2.0.1-1
- initial package, version 2.0.1
- open https://github.com/nikic/PHP-Parser/pull/268
make the autoloader more PSR-4