diff --git a/composer-noxdg.patch b/composer-noxdg.patch new file mode 100644 index 0000000..fc6b127 --- /dev/null +++ b/composer-noxdg.patch @@ -0,0 +1,14 @@ +diff -up ./src/Composer/Factory.php.noxdg ./src/Composer/Factory.php +--- ./src/Composer/Factory.php.noxdg 2021-05-31 15:37:50.548115679 +0200 ++++ ./src/Composer/Factory.php 2021-05-31 15:39:05.192882880 +0200 +@@ -653,6 +653,10 @@ class Factory + */ + private static function useXdg() + { ++ // As XDG is very patially implemted ++ // resulting in command/code in ~/.config ++ return false; ++ + foreach (array_keys($_SERVER) as $key) { + if (strpos($key, 'XDG_') === 0) { + return true; diff --git a/composer-rpm.patch b/composer-rpm.patch index 130d62d..cbb4b3c 100644 --- a/composer-rpm.patch +++ b/composer-rpm.patch @@ -1,6 +1,6 @@ diff -up ./bin/composer.rpm ./bin/composer ---- ./bin/composer.rpm 2020-12-04 08:01:03.000000000 +0100 -+++ ./bin/composer 2020-12-04 08:07:35.946138601 +0100 +--- ./bin/composer.rpm 2021-09-14 15:45:17.000000000 +0200 ++++ ./bin/composer 2021-09-14 15:45:33.025118009 +0200 @@ -6,7 +6,7 @@ if (PHP_SAPI !== 'cli' && PHP_SAPI !== ' } @@ -11,9 +11,9 @@ diff -up ./bin/composer.rpm ./bin/composer use Composer\Console\Application; use Composer\XdebugHandler\XdebugHandler; diff -up ./src/Composer/Autoload/AutoloadGenerator.php.rpm ./src/Composer/Autoload/AutoloadGenerator.php ---- ./src/Composer/Autoload/AutoloadGenerator.php.rpm 2020-12-04 08:01:03.000000000 +0100 -+++ ./src/Composer/Autoload/AutoloadGenerator.php 2020-12-04 08:07:35.946138601 +0100 -@@ -373,7 +373,7 @@ EOF; +--- ./src/Composer/Autoload/AutoloadGenerator.php.rpm 2021-09-14 15:45:17.000000000 +0200 ++++ ./src/Composer/Autoload/AutoloadGenerator.php 2021-09-14 15:45:33.025118009 +0200 +@@ -395,7 +395,7 @@ EOF; $filesystem->filePutContentsIfModified($targetDir.'/autoload_real.php', $this->getAutoloadRealFile(true, (bool) $includePathFileContents, $targetDirLoader, (bool) $includeFilesFileContents, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader, $staticPhpVersion, $checkPlatform)); $filesystem->safeCopy(__DIR__.'/ClassLoader.php', $targetDir.'/ClassLoader.php'); @@ -23,9 +23,9 @@ diff -up ./src/Composer/Autoload/AutoloadGenerator.php.rpm ./src/Composer/Autolo 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-12-04 08:01:03.000000000 +0100 -+++ ./src/Composer/Compiler.php 2020-12-04 08:07:35.946138601 +0100 -@@ -98,7 +98,7 @@ class Compiler +--- ./src/Composer/Compiler.php.rpm 2021-09-14 15:45:17.000000000 +0200 ++++ ./src/Composer/Compiler.php 2021-09-14 15:45:33.025118009 +0200 +@@ -118,7 +118,7 @@ class Compiler // Add Composer resources $finder = new Finder(); $finder->files() @@ -34,9 +34,30 @@ diff -up ./src/Composer/Compiler.php.rpm ./src/Composer/Compiler.php ->sort($finderSort) ; foreach ($finder as $file) { +diff -up ./src/Composer/InstalledVersions.php.rpm ./src/Composer/InstalledVersions.php +--- ./src/Composer/InstalledVersions.php.rpm 2021-09-14 15:45:17.000000000 +0200 ++++ ./src/Composer/InstalledVersions.php 2021-09-14 15:45:33.026118007 +0200 +@@ -251,7 +251,7 @@ class InstalledVersions + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 +- if (substr(__DIR__, -8, 1) !== 'C') { ++ if (substr(__DIR__, -8, 1) !== 'C' && is_file(__DIR__ . '/installed.php')) { + self::$installed = include __DIR__ . '/installed.php'; + } else { + self::$installed = array(); +@@ -324,7 +324,7 @@ class InstalledVersions + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 +- if (substr(__DIR__, -8, 1) !== 'C') { ++ if (substr(__DIR__, -8, 1) !== 'C' && is_file(__DIR__ . '/installed.php')) { + self::$installed = require __DIR__ . '/installed.php'; + } else { + self::$installed = array(); diff -up ./src/Composer/Json/JsonFile.php.rpm ./src/Composer/Json/JsonFile.php ---- ./src/Composer/Json/JsonFile.php.rpm 2020-12-04 08:01:03.000000000 +0100 -+++ ./src/Composer/Json/JsonFile.php 2020-12-04 08:07:35.946138601 +0100 +--- ./src/Composer/Json/JsonFile.php.rpm 2021-09-14 15:45:17.000000000 +0200 ++++ ./src/Composer/Json/JsonFile.php 2021-09-14 15:46:22.434026477 +0200 @@ -34,7 +34,7 @@ class JsonFile const JSON_PRETTY_PRINT = 128; const JSON_UNESCAPED_UNICODE = 256; @@ -44,21 +65,21 @@ diff -up ./src/Composer/Json/JsonFile.php.rpm ./src/Composer/Json/JsonFile.php - const COMPOSER_SCHEMA_PATH = '/../../../res/composer-schema.json'; + const COMPOSER_SCHEMA_PATH = '/usr/share/composer/res/composer-schema.json'; + /** @var string */ private $path; - private $httpDownloader; -@@ -179,7 +179,7 @@ class JsonFile - } - +@@ -191,7 +191,7 @@ class JsonFile + $isComposerSchemaFile = false; if (null === $schemaFile) { + $isComposerSchemaFile = true; - $schemaFile = __DIR__ . self::COMPOSER_SCHEMA_PATH; + $schemaFile = (getenv('BUILDROOT')?:'') . self::COMPOSER_SCHEMA_PATH; } // 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-12-04 08:01:03.000000000 +0100 -+++ ./tests/Composer/Test/Json/ComposerSchemaTest.php 2020-12-04 08:07:35.947138597 +0100 -@@ -113,7 +113,8 @@ class ComposerSchemaTest extends TestCas +--- ./tests/Composer/Test/Json/ComposerSchemaTest.php.rpm 2021-09-14 15:45:17.000000000 +0200 ++++ ./tests/Composer/Test/Json/ComposerSchemaTest.php 2021-09-14 15:45:33.025118009 +0200 +@@ -93,7 +93,8 @@ class ComposerSchemaTest extends TestCas private function check($json) { $validator = new Validator(); @@ -69,8 +90,8 @@ 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-12-04 08:07:35.947138597 +0100 -+++ ./tests/Composer/Test/PolyfillTestCase.php 2020-12-04 08:09:14.344707638 +0100 +--- ./tests/Composer/Test/PolyfillTestCase.php.rpm 2021-09-14 15:45:17.000000000 +0200 ++++ ./tests/Composer/Test/PolyfillTestCase.php 2021-09-14 15:45:33.026118007 +0200 @@ -15,10 +15,35 @@ namespace Composer\Test { use PHPUnit\Framework\Constraint\LogicalNot; use PHPUnit\Framework\Constraint\StringContains; diff --git a/composer.spec b/composer.spec index 1b18982..80eb123 100644 --- a/composer.spec +++ b/composer.spec @@ -1,6 +1,6 @@ # remirepo/fedora spec file for composer # -# Copyright (c) 2015-2020 Remi Collet +# Copyright (c) 2015-2021 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # @@ -10,24 +10,25 @@ # For compatibility with SCL %undefine __brp_mangle_shebangs -%global gh_commit 62139b2806178adb979d76bd3437534a1a9fd490 +%bcond_without tests + +%global gh_commit 6e3c2b122e0ec41a7e885fcaf19fa15e2e0819a0 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_branch 2.0-dev %global gh_owner composer %global gh_project composer -%global with_tests %{?_without_tests:0}%{!?_without_tests:1} -%global api_version 2.0.0 -%global run_version 2.0.0 +%global api_version 2.1.0 +%global run_version 2.1.0 -%global upstream_version 2.0.8 -#global upstream_prever RC2 -#global upstream_lower rc2 +%global upstream_version 2.1.12 +#global upstream_prever RC1 +#global upstream_lower rc1 -%global symfony_prefix php-symfony -%global symfony_path %{_datadir}/php/Symfony -%global symfony_min 2.8 +%global symfony_prefix php-symfony4 +%global symfony_path %{_datadir}/php/Symfony4 +%global symfony_min 4.4 -%global _phpunit %{_bindir}/phpunit +%global _phpunit %{_bindir}/phpunit9 Name: composer Version: %{upstream_version}%{?upstream_prever:~%{upstream_lower}} @@ -45,38 +46,29 @@ Source5: makesrc.sh # Use our autoloader, resources path, fix for tests Patch0: %{name}-rpm.patch +# Disable XDG support as only partially implemented +Patch1: %{name}-noxdg.patch BuildArch: noarch BuildRequires: php-cli -%if %{with_tests} -%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +%if %{with tests} BuildRequires: (php-composer(composer/ca-bundle) >= 1.0 with php-composer(composer/ca-bundle) < 2) +BuildRequires: (php-composer(composer/metadata-minifier) >= 1.0 with php-composer(composer/metadata-minifier) < 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(composer/xdebug-handler) >= 2.0 with php-composer(composer/xdebug-handler) < 3) 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(psr/log) >= 1.0 with php-composer(psr/log) < 3) +BuildRequires: (php-composer(justinrainbow/json-schema) >= 5.2.11 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-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 >= %{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 || ^5.0", +# "symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0", # "phpspec/prophecy": "^1.10" BuildRequires: %{_phpunit} # For autoloader @@ -88,41 +80,31 @@ BuildRequires: php-PsrLog >= 1.1 # From composer.json, "require": { # "php": "^5.3.2 || ^7.0", # "composer/ca-bundle": "^1.0", +# "composer/metadata-minifier": "^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" +# "composer/xdebug-handler": "^2.0", +# "justinrainbow/json-schema": "^5.2.11", +# "psr/log": "^1.0 || ^2.0" # "seld/jsonlint": "~1.4", # "seld/phar-utils": "^1.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", +# "symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", +# "symfony/filesystem": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", +# "symfony/finder": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", +# "symfony/process": "^^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.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/metadata-minifier) >= 1.0 with php-composer(composer/metadata-minifier) < 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(composer/xdebug-handler) >= 2.0 with php-composer(composer/xdebug-handler) < 3) 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(psr/log) >= 1.0 with php-composer(psr/log) < 3) +Requires: (php-composer(justinrainbow/json-schema) >= 5.2.11 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-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 >= %{symfony_min} Requires: %{symfony_prefix}-finder >= %{symfony_min} Requires: %{symfony_prefix}-process >= %{symfony_min} @@ -177,7 +159,8 @@ Documentation: https://getcomposer.org/doc/ %setup -q -n %{gh_project}-%{gh_commit} %patch0 -p1 -b .rpm -find . -name \*.rpm -exec rm {} \; -print +%patch1 -p1 -b .noxdg +find . \( -name \*.rpm -o -name \*noxdg \) -delete -print if grep -r '\.\./res'; then : Patch need to fixed @@ -188,6 +171,7 @@ phpab --template fedora --output src/Composer/autoload.php src/Composer cat << 'EOF' | tee -a src/Composer/autoload.php \Fedora\Autoloader\Dependencies::required([ + '%{_datadir}/php/Composer/XdebugHandler2/autoload.php', /* before symfony which load composer */ '%{symfony_path}/Component/Console/autoload.php', '%{symfony_path}/Component/Finder/autoload.php', '%{symfony_path}/Component/Process/autoload.php', @@ -196,9 +180,12 @@ cat << 'EOF' | tee -a src/Composer/autoload.php '%{_datadir}/php/Seld/PharUtils/autoload.php', '%{_datadir}/php/Composer/CaBundle/autoload.php', '%{_datadir}/php/Composer/Spdx/autoload.php', + '%{_datadir}/php/Composer/MetadataMinifier/autoload.php', '%{_datadir}/php/Composer/Semver3/autoload.php', - '%{_datadir}/php/Composer/XdebugHandler/autoload.php', - '%{_datadir}/php/Psr/Log/autoload.php', + [ + '%{_datadir}/php/Psr/Log2/autoload.php', + '%{_datadir}/php/Psr/Log/autoload.php', + ], '%{_datadir}/php/JsonSchema5/autoload.php', '%{_datadir}/php/React/Promise/autoload.php', ]); @@ -265,7 +252,7 @@ install -Dpm 755 bin/%{name} %{buildroot}%{_bindir}/%{name} %check -%if %{with_tests} +%if %{with tests} : Online tests rm tests/Composer/Test/Util/RemoteFilesystemTest.php @@ -275,15 +262,20 @@ rm -rf res : Run test suite export BUILDROOT=%{buildroot} -%if 0%{?rhel} == 6 -FILTER="--filter '^((?!(testIntegration|testArchiveCustomFileName|testArchiveTar)).)*$'" -%else FILTER="--filter '^((?!(testIntegration)).)*$'" -%endif + +# Adapt for phunit9 +find tests \ + -name \*.php \ + -exec sed -e '/function setUpBeforeClass(/s/$/:void/' \ + -e '/function tearDownAfterClass(/s/$/:void/' \ + -e '/function setUp(/s/$/:void/' \ + -e '/function tearDown(/s/$/:void/' \ + -i {} \; # testIntegration may hang on local build ret=0 -for cmd in php php72 php73 php74; do +for cmd in php php73 php74 php80 php81; do if which $cmd; then $cmd -d memory_limit=1G %{_phpunit} \ $FILTER \ @@ -308,6 +300,75 @@ exit $ret %changelog +* Tue Nov 9 2021 Remi Collet - 2.1.12-1 +- update to 2.1.12 + +* Tue Nov 2 2021 Remi Collet - 2.1.11-1 +- update to 2.1.11 + +* Sat Oct 30 2021 Remi Collet - 2.1.10-1 +- update to 2.1.10 +- allow psr/log v2 + +* Tue Oct 5 2021 Remi Collet - 2.1.9-1 +- update to 2.1.9 + +* Sat Sep 18 2021 Remi Collet - 2.1.8-1 +- update to 2.1.8 + +* Tue Sep 14 2021 Remi Collet - 2.1.7-1 +- update to 2.1.7 + +* Mon Aug 23 2021 Remi Collet - 2.1.6-1 +- update to 2.1.6 + +* Fri Jul 23 2021 Remi Collet - 2.1.5-1 +- update to 2.1.5 + +* Thu Jul 22 2021 Remi Collet - 2.1.4-1 +- update to 2.1.4 +- raise dependency on justinrainbow/json-schema 5.2.11 + +* Thu Jun 10 2021 Remi Collet - 2.1.3-1 +- update to 2.1.3 + +* Mon Jun 7 2021 Remi Collet - 2.1.2-1 +- update to 2.1.2 + +* Mon Jun 7 2021 Remi Collet - 2.1.1-2 +- fix Composer\InstalledVersions RPM installation + +* Fri Jun 4 2021 Remi Collet - 2.1.1-1 +- update to 2.1.1 + +* Thu Jun 3 2021 Remi Collet - 2.1.0-1 +- update to 2.1.0 + +* Mon May 31 2021 Remi Collet - 2.0.14-2 +- disable XDG directories usage, see #1955455 + +* Sat May 22 2021 Remi Collet - 2.0.14-1 +- update to 2.0.14 +- switch to composer/xdebug-handler v2 + +* Tue Apr 27 2021 Remi Collet - 2.0.13-1 +- update to 2.0.13 +- add dependency on composer/metadata-minifier + +* Thu Apr 1 2021 Remi Collet - 2.0.12-1 +- update to 2.0.12 + +* Wed Feb 24 2021 Remi Collet - 2.0.11-1 +- update to 2.0.11 + +* Tue Feb 23 2021 Remi Collet - 2.0.10-1 +- update to 2.0.10 + +* Thu Jan 28 2021 Remi Collet - 2.0.9-1 +- update to 2.0.9 +- switch to Symfony 4 +- switch to phpunit9 + * Fri Dec 4 2020 Remi Collet - 2.0.8-1 - update to 2.0.8 diff --git a/sources b/sources index 16a0a5d..d953e33 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (composer-2.0.8-62139b2.tgz) = 852ff831849c7fe230feadfe4a2b516662d9cd339d885f0ec2a0e2e31ab51c22105deaf6e3fc2d04b97aca4a91b67def8f8ad047636321662963f0fbd2d845ca +SHA512 (composer-2.1.12-6e3c2b1.tgz) = 834e06a70deb4bed4887e6acf626de2a2b27f3cf42cc405dcdbe74cf25ab14750123dfd780243e3fec0920adc0ac96ed72517600f39134e3730f17dc7a7060b6