From 6a289b8d43d652c72d9c970bcd008d02ba778637 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Oct 26 2020 09:47:27 +0000 Subject: update to 2.0.2 raise dependency on composer/semver 3 add dependency on react/promise 2.7 --- diff --git a/composer-autoload.php b/composer-autoload.php deleted file mode 100644 index 15e9c21..0000000 --- a/composer-autoload.php +++ /dev/null @@ -1,24 +0,0 @@ -filePutContentsIfModified($targetDir.'/autoload_real.php', $this->getAutoloadRealFile(true, (bool) $includePathFileContents, $targetDirLoader, (bool) $includeFilesFileContents, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader, $staticPhpVersion)); +--- ./src/Composer/Autoload/AutoloadGenerator.php.rpm 2020-10-25 06:23:06.000000000 +0100 ++++ ./src/Composer/Autoload/AutoloadGenerator.php 2020-10-25 06:23:12.863707931 +0100 +@@ -364,7 +364,7 @@ EOF; + $filesystem->filePutContentsIfModified($targetDir.'/autoload_real.php', $this->getAutoloadRealFile(true, (bool) $includePathFileContents, $targetDirLoader, (bool) $includeFilesFileContents, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader, $staticPhpVersion, $checkPlatform)); - $this->safeCopy(__DIR__.'/ClassLoader.php', $targetDir.'/ClassLoader.php'); -- $this->safeCopy(__DIR__.'/../../../LICENSE', $targetDir.'/LICENSE'); -+ $this->safeCopy((getenv('BUILDROOT')?:'') . '/usr/share/composer/LICENSE', $targetDir.'/LICENSE'); + $filesystem->safeCopy(__DIR__.'/ClassLoader.php', $targetDir.'/ClassLoader.php'); +- $filesystem->safeCopy(__DIR__.'/../../../LICENSE', $targetDir.'/LICENSE'); ++ $filesystem->safeCopy((getenv('BUILDROOT')?:'') . '/usr/share/composer/LICENSE', $targetDir.'/LICENSE'); if ($this->runScripts) { $this->eventDispatcher->dispatchScript(ScriptEvents::POST_AUTOLOAD_DUMP, $this->devMode, array(), array( diff -up ./src/Composer/Compiler.php.rpm ./src/Composer/Compiler.php ---- ./src/Composer/Compiler.php.rpm 2020-02-14 15:37:41.000000000 +0100 -+++ ./src/Composer/Compiler.php 2020-02-14 15:37:43.336528140 +0100 -@@ -97,7 +97,7 @@ class Compiler +--- ./src/Composer/Compiler.php.rpm 2020-10-25 06:23:12.863707931 +0100 ++++ ./src/Composer/Compiler.php 2020-10-25 06:26:14.912591239 +0100 +@@ -99,7 +99,7 @@ class Compiler + // Add Composer resources $finder = new Finder(); $finder->files() - ->name('*.json') - ->in(__DIR__.'/../../res') + ->in((getenv('BUILDROOT')?:'') . '/usr/share/composer/res') - ->in(SpdxLicenses::getResourcesDir()) ->sort($finderSort) ; + foreach ($finder as $file) { diff -up ./src/Composer/Json/JsonFile.php.rpm ./src/Composer/Json/JsonFile.php ---- ./src/Composer/Json/JsonFile.php.rpm 2020-02-14 15:37:41.000000000 +0100 -+++ ./src/Composer/Json/JsonFile.php 2020-02-14 15:37:43.336528140 +0100 +--- ./src/Composer/Json/JsonFile.php.rpm 2020-10-25 06:23:06.000000000 +0100 ++++ ./src/Composer/Json/JsonFile.php 2020-10-25 06:23:12.863707931 +0100 @@ -34,7 +34,7 @@ class JsonFile const JSON_PRETTY_PRINT = 128; const JSON_UNESCAPED_UNICODE = 256; @@ -45,8 +45,8 @@ diff -up ./src/Composer/Json/JsonFile.php.rpm ./src/Composer/Json/JsonFile.php + const COMPOSER_SCHEMA_PATH = '/usr/share/composer/res/composer-schema.json'; private $path; - private $rfs; -@@ -173,7 +173,7 @@ class JsonFile + private $httpDownloader; +@@ -179,7 +179,7 @@ class JsonFile } if (null === $schemaFile) { @@ -56,9 +56,9 @@ diff -up ./src/Composer/Json/JsonFile.php.rpm ./src/Composer/Json/JsonFile.php // Prepend with file:// only when not using a special schema already (e.g. in the phar) diff -up ./tests/Composer/Test/Json/ComposerSchemaTest.php.rpm ./tests/Composer/Test/Json/ComposerSchemaTest.php ---- ./tests/Composer/Test/Json/ComposerSchemaTest.php.rpm 2020-02-14 15:37:41.000000000 +0100 -+++ ./tests/Composer/Test/Json/ComposerSchemaTest.php 2020-02-14 15:37:43.336528140 +0100 -@@ -97,7 +97,8 @@ class ComposerSchemaTest extends TestCas +--- ./tests/Composer/Test/Json/ComposerSchemaTest.php.rpm 2020-10-25 06:23:06.000000000 +0100 ++++ ./tests/Composer/Test/Json/ComposerSchemaTest.php 2020-10-25 06:23:12.863707931 +0100 +@@ -113,7 +113,8 @@ class ComposerSchemaTest extends TestCas private function check($json) { $validator = new Validator(); @@ -68,3 +68,41 @@ diff -up ./tests/Composer/Test/Json/ComposerSchemaTest.php.rpm ./tests/Composer/ if (!$validator->isValid()) { $errors = $validator->getErrors(); +diff -up ./tests/Composer/Test/PolyfillTestCase.php.rpm ./tests/Composer/Test/PolyfillTestCase.php +--- ./tests/Composer/Test/PolyfillTestCase.php.rpm 2020-10-25 06:23:06.000000000 +0100 ++++ ./tests/Composer/Test/PolyfillTestCase.php 2020-10-25 06:23:12.863707931 +0100 +@@ -18,8 +18,33 @@ namespace Composer\Test { + use PHPUnit\Framework\Constraint\StringContains; + use PHPUnit\Framework\Constraint\TraversableContains; + +- if (method_exists('PHPUnit\Framework\TestCase', 'assertStringContainsString')) { ++ if (method_exists('PHPUnit\Framework\TestCase', 'assertFileDoesNotExist')) { + abstract class PolyfillTestCase extends TestCase {} ++ } else if (method_exists('PHPUnit\Framework\TestCase', 'assertStringContainsString')) { ++ abstract class PolyfillTestCase extends TestCase { ++ /** ++ * @param string $filename ++ * @param string $message ++ * ++ * @return void ++ */ ++ public static function assertFileDoesNotExist($filename, $message = '') ++ { ++ static::assertFileNotExists($filename, $message); ++ } ++ ++ /** ++ * @param string $pattern ++ * @param string $string ++ * @param string $message ++ * ++ * @return void ++ */ ++ public static function assertMatchesRegularExpression($pattern, $string, $message = '') ++ { ++ static::assertRegExp($pattern, $string, $message); ++ } ++ } + } else { + abstract class PolyfillTestCase extends TestCase + { diff --git a/composer.spec b/composer.spec index 638d41d..2f8ecca 100644 --- a/composer.spec +++ b/composer.spec @@ -10,36 +10,33 @@ # For compatibility with SCL %undefine __brp_mangle_shebangs -%bcond_without tests - -%global gh_commit 547c9ee73fe26c77af09a0ea16419176b1cdbd12 +%global gh_commit 74e8c71026edba786290047199619ac6b6490094 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) -%global gh_branch 1.0-dev +%global gh_branch 2.0-dev %global gh_owner composer %global gh_project composer -%global api_version 1.1.0 -%global run_version 1.0.0 +%global with_tests %{?_without_tests:0}%{!?_without_tests:1} +%global api_version 2.0.0 +%global run_version 2.0.0 -%global upstream_version 1.10.15 -#global upstream_prever RC +%global upstream_version 2.0.2 +#global upstream_prever RC2 +#global upstream_lower rc2 -%if 0 -# see https://forum.remirepo.net/viewtopic.php?id=3677 -%global symfony_prefix php-symfony3 -%else %global symfony_prefix php-symfony -%endif +%global symfony_path %{_datadir}/php/Symfony +%global symfony_min 2.8 + +%global _phpunit %{_bindir}/phpunit Name: composer -Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}} +Version: %{upstream_version}%{?upstream_prever:~%{upstream_lower}} Release: 1%{?dist} Summary: Dependency Manager for PHP License: MIT URL: https://getcomposer.org/ Source0: %{gh_project}-%{upstream_version}%{?upstream_prever}-%{gh_short}.tgz -Source1: %{name}-autoload.php -Source2: %{name}-bootstrap.php # Profile scripts Source3: %{name}.sh Source4: %{name}.csh @@ -51,80 +48,85 @@ Patch0: %{name}-rpm.patch BuildArch: noarch BuildRequires: php-cli -%if %{with tests} +%if %{with_tests} %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 BuildRequires: (php-composer(composer/ca-bundle) >= 1.0 with php-composer(composer/ca-bundle) < 2) -BuildRequires: (php-composer(composer/semver) >= 1.0 with php-composer(composer/semver) < 2) +BuildRequires: (php-composer(composer/semver) >= 3.0 with php-composer(composer/semver) < 4) BuildRequires: (php-composer(composer/spdx-licenses) >= 1.2 with php-composer(composer/spdx-licenses) < 2) BuildRequires: (php-composer(composer/xdebug-handler) >= 1.1 with php-composer(composer/xdebug-handler) < 2) BuildRequires: (php-composer(seld/jsonlint) >= 1.4 with php-composer(seld/jsonlint) < 2) BuildRequires: (php-composer(seld/phar-utils) >= 1.0 with php-composer(seld/phar-utils) < 2) BuildRequires: (php-composer(psr/log) >= 1.0 with php-composer(psr/log) < 2) BuildRequires: (php-composer(justinrainbow/json-schema) >= 5.2.10 with php-composer(justinrainbow/json-schema) < 6) +BuildRequires: (php-composer(react/promise) >= 2.7 with php-composer(react/promise) < 3) %else BuildRequires: php-composer-ca-bundle -BuildRequires: php-composer-semver +BuildRequires: php-composer-semver3 BuildRequires: php-composer-spdx-licenses >= 1.2 BuildRequires: php-composer-xdebug-handler >= 1.1 BuildRequires: php-jsonlint >= 1.4 BuildRequires: php-seld-phar-utils BuildRequires: php-PsrLog BuildRequires: php-justinrainbow-json-schema5 >= 5.2.10 +BuildRequires: php-react-promise >= 2.7 %endif -BuildRequires: %{symfony_prefix}-console -BuildRequires: %{symfony_prefix}-finder -BuildRequires: %{symfony_prefix}-filesystem -BuildRequires: %{symfony_prefix}-process +BuildRequires: %{symfony_prefix}-console >= %{symfony_min} +BuildRequires: %{symfony_prefix}-finder >= %{symfony_min} +BuildRequires: %{symfony_prefix}-filesystem >= %{symfony_min} +BuildRequires: %{symfony_prefix}-process >= %{symfony_min} BuildRequires: php-zip # From composer.json, "require-dev": { -# "symfony/phpunit-bridge": "^4.2", +# "symfony/phpunit-bridge": "^4.2 || ^5.0", # "phpspec/prophecy": "^1.10" -BuildRequires: phpunit +BuildRequires: %{_phpunit} # For autoloader -BuildRequires: php-composer(fedora/autoloader) >= 0.1.2 -BuildRequires: php-seld-phar-utils >= 1.0.1 -BuildRequires: php-PsrLog >= 1.0.0-8 +BuildRequires: php-fedora-autoloader-devel +BuildRequires: php-seld-phar-utils >= 1.1 +BuildRequires: php-PsrLog >= 1.1 %endif # From composer.json, "require": { # "php": "^5.3.2 || ^7.0", # "composer/ca-bundle": "^1.0", -# "composer/semver": "^1.0", +# "composer/semver": "^3.0", # "composer/spdx-licenses": "^1.2", # "composer/xdebug-handler": "^1.1", # "justinrainbow/json-schema": "^5.2.10", # "psr/log": "^1.0" # "seld/jsonlint": "~1.4", # "seld/phar-utils": "^1.0", -# "symfony/console": "^2.7 || ^3.0 || ^4.0 || ^5.0", -# "symfony/filesystem": "^2.7 || ^3.0 || ^4.0 || ^5.0", -# "symfony/finder": "^2.7 || ^3.0 || ^4.0 || ^5.0", -# "symfony/process": "^2.7 || ^3.0 || ^4.0 || ^5.0", +# "symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0", +# "symfony/filesystem": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0", +# "symfony/finder": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0", +# "symfony/process": "^^2.8.52 || ^3.4.35 || ^4.4 || ^5.0", +# "react/promise": "^1.2 || ^2.7" Requires: php(language) >= 5.3.2 Requires: php-cli %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 Requires: (php-composer(composer/ca-bundle) >= 1.0 with php-composer(composer/ca-bundle) < 2) -Requires: (php-composer(composer/semver) >= 1.0 with php-composer(composer/semver) < 2) +Requires: (php-composer(composer/semver) >= 3.0 with php-composer(composer/semver) < 4) Requires: (php-composer(composer/spdx-licenses) >= 1.2 with php-composer(composer/spdx-licenses) < 2) Requires: (php-composer(composer/xdebug-handler) >= 1.1 with php-composer(composer/xdebug-handler) < 2) Requires: (php-composer(seld/jsonlint) >= 1.4 with php-composer(seld/jsonlint) < 2) Requires: (php-composer(seld/phar-utils) >= 1.0 with php-composer(seld/phar-utils) < 2) Requires: (php-composer(psr/log) >= 1.0 with php-composer(psr/log) < 2) Requires: (php-composer(justinrainbow/json-schema) >= 5.2.10 with php-composer(justinrainbow/json-schema) < 6) +Requires: (php-composer(react/promise) >= 2.7 with php-composer(react/promise) < 3) %else Requires: php-composer-ca-bundle -Requires: php-composer-semver +Requires: php-composer-semver3 Requires: php-composer-spdx-licenses >= 1.2 Requires: php-composer-xdebug-handler >= 1.1 Requires: php-jsonlint >= 1.4 Requires: php-seld-phar-utils Requires: php-PsrLog Requires: php-justinrainbow-json-schema5 >= 5.2.10 +Requires: php-react-promise >= 2.7 %endif -Requires: %{symfony_prefix}-console -Requires: %{symfony_prefix}-finder -Requires: %{symfony_prefix}-process -Requires: %{symfony_prefix}-filesystem +Requires: %{symfony_prefix}-console >= %{symfony_min} +Requires: %{symfony_prefix}-finder >= %{symfony_min} +Requires: %{symfony_prefix}-process >= %{symfony_min} +Requires: %{symfony_prefix}-filesystem >= %{symfony_min} # From composer.json, suggest # "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", # "ext-zip": "Enabling the zip extension allows you to unzip archives", @@ -134,12 +136,12 @@ Requires: php-zip Requires: php-zlib # For our autoloader Requires: php-composer(fedora/autoloader) -Requires: php-seld-phar-utils >= 1.0.1 -Requires: php-PsrLog >= 1.0.0-8 -# From phpcompatinfo +Requires: php-seld-phar-utils >= 1.1 +Requires: php-PsrLog >= 1.1 +# From phpcompatinfo for version 2.0.0 +Requires: php-ctype Requires: php-curl Requires: php-date -Requires: php-dom Requires: php-filter Requires: php-hash Requires: php-iconv @@ -147,10 +149,11 @@ Requires: php-intl Requires: php-json Requires: php-libxml Requires: php-mbstring +Requires: php-pcntl Requires: php-pcre Requires: php-phar +Requires: php-posix Requires: php-reflection -Requires: php-simplexml Requires: php-spl Requires: php-tokenizer Requires: php-xsl @@ -181,10 +184,35 @@ if grep -r '\.\./res'; then exit 1 fi -cp -p %{SOURCE1} src/Composer/autoload.php -cp -p %{SOURCE2} tests/bootstrap.php +phpab --template fedora --output src/Composer/autoload.php src/Composer +cat << 'EOF' | tee -a src/Composer/autoload.php + +\Fedora\Autoloader\Dependencies::required([ + '%{symfony_path}/Component/Console/autoload.php', + '%{symfony_path}/Component/Finder/autoload.php', + '%{symfony_path}/Component/Process/autoload.php', + '%{symfony_path}/Component/Filesystem/autoload.php', + '%{_datadir}/php/Seld/JsonLint/autoload.php', + '%{_datadir}/php/Seld/PharUtils/autoload.php', + '%{_datadir}/php/Composer/CaBundle/autoload.php', + '%{_datadir}/php/Composer/Spdx/autoload.php', + '%{_datadir}/php/Composer/Semver3/autoload.php', + '%{_datadir}/php/Composer/XdebugHandler/autoload.php', + '%{_datadir}/php/Psr/Log/autoload.php', + '%{_datadir}/php/JsonSchema5/autoload.php', + '%{_datadir}/php/React/Promise/autoload.php', +]); +EOF + +cat << 'EOF' | tee tests/bootstrap.php + - 2.0.2-1 +- update to 2.0.2 +- raise dependency on composer/semver 3 +- add dependency on react/promise 2.7 + * Tue Oct 13 2020 Remi Collet - 1.10.15-1 - update to 1.10.15 diff --git a/sources b/sources index 503aa56..54b6b85 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (composer-1.10.15-547c9ee.tgz) = 0e70f80775ec0136bacef5da353efbbc9786e4eb33b8e209c9b3350a3dbe8d65784ac3e920cc2b605f08e03d5dbe9c823505750ed9c04fcbfc85b438b800c66c +SHA512 (composer-2.0.2-74e8c71.tgz) = 53783ffb741552f75e53e704b3b5c325807b337a4eb34ea111b8b2375cef095bfe71d2c48315cce7b8d6c844527a9ddc5b47b5dac5bf916203669db04f3d176d