From 1b145b67a216f4b3d5dfd88cce9019e506127bab Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 16 Jul 2015 09:36:51 +0200 Subject: composer-1.0.0-0.7.20150714git92faf1c --- composer-pr4169.patch | 2 +- composer-pr4262.patch | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++ composer-rpm.patch | 64 ++++++++++++++--------------------- composer.spec | 20 +++++++---- 4 files changed, 132 insertions(+), 46 deletions(-) create mode 100644 composer-pr4262.patch diff --git a/composer-pr4169.patch b/composer-pr4169.patch index dc419c2..46a47d3 100644 --- a/composer-pr4169.patch +++ b/composer-pr4169.patch @@ -11,7 +11,7 @@ diff --git a/tests/Composer/Test/Util/RemoteFilesystemTest.php b/tests/Composer/ index 04502eb..62a70c9 100644 --- a/tests/Composer/Test/Util/RemoteFilesystemTest.php +++ b/tests/Composer/Test/Util/RemoteFilesystemTest.php -@@ -137,6 +137,9 @@ public function testCallbackGetPassesThrough404() +@@ -136,6 +136,9 @@ public function testCallbackGetPassesThrough404() $this->assertNull($this->callCallbackGet($fs, STREAM_NOTIFY_FAILURE, 0, 'HTTP/1.1 404 Not Found', 404, 0, 0)); } diff --git a/composer-pr4262.patch b/composer-pr4262.patch new file mode 100644 index 0000000..5508f0e --- /dev/null +++ b/composer-pr4262.patch @@ -0,0 +1,92 @@ +From b0b73751be69058ca61109bde9eafeda114c620a Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Thu, 16 Jul 2015 09:20:36 +0200 +Subject: [PATCH 1/2] fix for changes in justinrainbow/json-schema 1.4.4 + +--- + composer.json | 2 +- + tests/Composer/Test/Json/ComposerSchemaTest.php | 12 ++++++------ + 2 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/composer.json b/composer.json +index ffac4f2..91e385e 100644 +--- a/composer.json ++++ b/composer.json +@@ -23,7 +23,7 @@ + }, + "require": { + "php": ">=5.3.2", +- "justinrainbow/json-schema": "~1.4", ++ "justinrainbow/json-schema": "^1.4.4", + "seld/jsonlint": "~1.0", + "symfony/console": "~2.5", + "symfony/finder": "~2.2", +diff --git a/tests/Composer/Test/Json/ComposerSchemaTest.php b/tests/Composer/Test/Json/ComposerSchemaTest.php +index 1b8805f..cf44d4a 100644 +--- a/tests/Composer/Test/Json/ComposerSchemaTest.php ++++ b/tests/Composer/Test/Json/ComposerSchemaTest.php +@@ -23,18 +23,18 @@ public function testRequiredProperties() + { + $json = '{ }'; + $this->assertEquals(array( +- array('property' => '', 'message' => 'the property name is required'), +- array('property' => '', 'message' => 'the property description is required'), ++ array('property' => 'name', 'message' => 'The property name is required'), ++ array('property' => 'description', 'message' => 'The property description is required'), + ), $this->check($json)); + + $json = '{ "name": "vendor/package" }'; + $this->assertEquals(array( +- array('property' => '', 'message' => 'the property description is required'), ++ array('property' => 'description', 'message' => 'The property description is required'), + ), $this->check($json)); + + $json = '{ "description": "generic description" }'; + $this->assertEquals(array( +- array('property' => '', 'message' => 'the property name is required'), ++ array('property' => 'name', 'message' => 'The property name is required'), + ), $this->check($json)); + } + +@@ -44,7 +44,7 @@ public function testMinimumStabilityValues() + $this->assertEquals(array( + array( + 'property' => 'minimum-stability', +- 'message' => 'does not match the regex pattern ^dev|alpha|beta|rc|RC|stable$' ++ 'message' => 'Does not match the regex pattern ^dev|alpha|beta|rc|RC|stable$' + ), + ), $this->check($json), 'empty string'); + +@@ -52,7 +52,7 @@ public function testMinimumStabilityValues() + $this->assertEquals(array( + array( + 'property' => 'minimum-stability', +- 'message' => 'does not match the regex pattern ^dev|alpha|beta|rc|RC|stable$' ++ 'message' => 'Does not match the regex pattern ^dev|alpha|beta|rc|RC|stable$' + ), + ), $this->check($json), 'dummy'); + + +From 128901a8d0bb3ff54c0b2dc94638632e07f7ad79 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Thu, 16 Jul 2015 09:21:13 +0200 +Subject: [PATCH 2/2] ignore this test with 'jsonc' + +--- + tests/Composer/Test/Json/JsonFileTest.php | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/tests/Composer/Test/Json/JsonFileTest.php b/tests/Composer/Test/Json/JsonFileTest.php +index 279ccd9..ee65629 100644 +--- a/tests/Composer/Test/Json/JsonFileTest.php ++++ b/tests/Composer/Test/Json/JsonFileTest.php +@@ -54,6 +54,9 @@ public function testParseErrorSkipsEscapedBackslash() + + public function testParseErrorDetectSingleQuotes() + { ++ if (defined('JSON_PARSER_NOTSTRICT')) { ++ $this->markTestSkipped('jsonc issue'); ++ } + $json = '{ + \'foo\': "bar" + }'; diff --git a/composer-rpm.patch b/composer-rpm.patch index 858abb1..52d26ad 100644 --- a/composer-rpm.patch +++ b/composer-rpm.patch @@ -1,18 +1,18 @@ diff -up ./bin/composer.rpm ./bin/composer ---- ./bin/composer.rpm 2015-05-25 15:29:26.000000000 +0200 -+++ ./bin/composer 2015-05-26 15:36:46.984350206 +0200 +--- ./bin/composer.rpm 2015-07-14 14:37:15.000000000 +0200 ++++ ./bin/composer 2015-07-16 08:58:33.415021590 +0200 @@ -5,7 +5,7 @@ if (PHP_SAPI !== 'cli') { echo 'Warning: Composer should be invoked via the CLI version of PHP, not the '.PHP_SAPI.' SAPI'.PHP_EOL; } - + -require __DIR__.'/../src/bootstrap.php'; +require '/usr/share/php/Composer/autoload.php'; - + use Composer\Console\Application; - + diff -up ./src/Composer/Json/JsonFile.php.rpm ./src/Composer/Json/JsonFile.php ---- ./src/Composer/Json/JsonFile.php.rpm 2015-02-25 20:44:34.000000000 +0100 -+++ ./src/Composer/Json/JsonFile.php 2015-02-26 10:25:16.012610034 +0100 +--- ./src/Composer/Json/JsonFile.php.rpm 2015-07-14 14:37:15.000000000 +0200 ++++ ./src/Composer/Json/JsonFile.php 2015-07-16 08:58:33.415021590 +0200 @@ -149,7 +149,7 @@ class JsonFile self::validateSyntax($content, $this->path); } @@ -22,38 +22,24 @@ diff -up ./src/Composer/Json/JsonFile.php.rpm ./src/Composer/Json/JsonFile.php $schemaData = json_decode(file_get_contents($schemaFile)); if ($schema === self::LAX_SCHEMA) { -diff -up src/Composer/Util/SpdxLicense.php.old src/Composer/Util/SpdxLicense.php ---- ./src/Composer/Util/SpdxLicense.php.old 2015-04-17 09:57:53.680999733 +0200 -+++ ./src/Composer/Util/SpdxLicense.php 2015-04-17 09:59:50.397498276 +0200 -@@ -38,7 +38,7 @@ class SpdxLicense +diff -up ./src/Composer/Util/SpdxLicense.php.rpm ./src/Composer/Util/SpdxLicense.php +--- ./src/Composer/Util/SpdxLicense.php.rpm 2015-07-16 08:58:33.415021590 +0200 ++++ ./src/Composer/Util/SpdxLicense.php 2015-07-16 08:59:36.006332340 +0200 +@@ -167,7 +167,7 @@ class SpdxLicense return $this->licenses; } - -- $jsonFile = new JsonFile(__DIR__ . '/../../../res/spdx-licenses.json'); -+ $jsonFile = new JsonFile((getenv('BUILDROOT')?:'') . '/usr/share/composer/res/spdx-licenses.json'); - $this->licenses = $jsonFile->read(); - + +- $jsonFile = file_get_contents(__DIR__ . '/../../../res/spdx-licenses.json'); ++ $jsonFile = file_get_contents((getenv('BUILDROOT')?:'') . '/usr/share/composer/res/spdx-licenses.json'); + $this->licenses = json_decode($jsonFile, true); + return $this->licenses; -diff -up src/Composer/Util/SpdxLicensesUpdater.php.old src/Composer/Util/SpdxLicensesUpdater.php ---- ./src/Composer/Util/SpdxLicensesUpdater.php.old 2015-04-17 09:58:00.645029479 +0200 -+++ ./src/Composer/Util/SpdxLicensesUpdater.php 2015-04-17 10:00:36.578695534 +0200 -@@ -28,7 +28,7 @@ class SpdxLicensesUpdater - { - $json = json_encode($this->getLicenses(), true); - $prettyJson = JsonFormatter::format($json, true, true); -- file_put_contents(__DIR__ . '/../../../res/spdx-licenses.json', $prettyJson); -+ file_put_contents((getenv('BUILDROOT')?:'') . '/usr/share/composer/res/spdx-licenses.json', $prettyJson); - } - - private function getLicenses() -diff -up ./tests/Composer/Test/Json/JsonFileTest.php.rpm ./tests/Composer/Test/Json/JsonFileTest.php ---- ./tests/Composer/Test/Json/JsonFileTest.php.rpm 2015-02-26 10:26:10.607821640 +0100 -+++ ./tests/Composer/Test/Json/JsonFileTest.php 2015-02-26 10:27:05.430034125 +0100 -@@ -54,6 +54,7 @@ class JsonFileTest extends \PHPUnit_Fram - - public function testParseErrorDetectSingleQuotes() - { -+ $this->markTestSkipped('jsonc issue'); - $json = '{ - \'foo\': "bar" - }'; +@@ -182,7 +182,7 @@ class SpdxLicense + return $this->exceptions; + } + +- $jsonFile = file_get_contents(__DIR__ . '/../../../res/spdx-exceptions.json'); ++ $jsonFile = file_get_contents((getenv('BUILDROOT')?:'') . '/usr/share/composer/res/spdx-exceptions.json'); + $this->exceptions = json_decode($jsonFile, true); + + return $this->exceptions; diff --git a/composer.spec b/composer.spec index c86d9dc..e110249 100644 --- a/composer.spec +++ b/composer.spec @@ -6,17 +6,17 @@ # # Please, preserve the changelog entries # -%global gh_commit 943107cfe717a74aa791f57b87fa514c88582b0d +%global gh_commit 92faf1c7a83a73794fb914a990be435e1df373ca %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_branch 1.0-dev -%global gh_date 20150626 +%global gh_date 20150714 %global gh_owner composer %global gh_project composer %global with_tests %{?_without_tests:0}%{!?_without_tests:1} Name: composer Version: 1.0.0 -Release: 0.6.%{gh_date}git%{gh_short}%{?dist} +Release: 0.7.%{gh_date}git%{gh_short}%{?dist} Summary: Dependency Manager for PHP Group: Development/Libraries @@ -31,11 +31,14 @@ Patch0: %{name}-rpm.patch # https://github.com/composer/composer/pull/4169 # skip online tests Patch1: %{name}-pr4169.patch +# https://github.com/composer/composer/pull/4262 +# fix for tests +Patch2: %{name}-pr4262.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch %if %{with_tests} -BuildRequires: php-composer(justinrainbow/json-schema) >= 1.4 +BuildRequires: php-composer(justinrainbow/json-schema) >= 1.4.4 BuildRequires: php-composer(seld/jsonlint) >= 1.0 BuildRequires: php-composer(symfony/console) >= 2.5 BuildRequires: php-composer(symfony/finder) >= 2.2 @@ -47,7 +50,7 @@ BuildRequires: php-zip # From composer.json, requires # "php": ">=5.3.2", -# "justinrainbow/json-schema": "~1.4", +# "justinrainbow/json-schema": "^1.4.4", # "seld/jsonlint": "~1.0", # "symfony/console": "~2.5", # "symfony/finder": "~2.2", @@ -56,7 +59,7 @@ BuildRequires: php-zip # "seld/cli-prompt": "~1.0" Requires: php(language) >= 5.3.2 Requires: php-cli -Requires: php-composer(justinrainbow/json-schema) >= 1.4 +Requires: php-composer(justinrainbow/json-schema) >= 1.4.4 Requires: php-composer(justinrainbow/json-schema) < 2 Requires: php-composer(seld/jsonlint) >= 1.0 Requires: php-composer(seld/jsonlint) < 2 @@ -112,6 +115,7 @@ Documentation: https://getcomposer.org/doc/ %patch0 -p1 %patch1 -p1 +%patch2 -p1 cp -p %{SOURCE1} src/Composer/autoload.php cp -p %{SOURCE2} tests/bootstrap.php @@ -171,6 +175,10 @@ rm -rf %{buildroot} %changelog +* Thu Jul 16 2015 Remi Collet - 1.0.0-0.7.20150714git92faf1c +- new snapshot +- raise dependency on justinrainbow/json-schema 1.4.4 + * Mon Jun 29 2015 Remi Collet - 1.0.0-0.6.20150626git943107c - new snapshot - review autoloader -- cgit