diff --git a/composer-bash-completion b/composer-bash-completion index 5d484cc..c7e5ec9 100644 --- a/composer-bash-completion +++ b/composer-bash-completion @@ -11,18 +11,21 @@ _sf_composer() { local sf_cmd="${COMP_WORDS[0]}" # for an alias, get the real script behind it - if [[ $(type -t $sf_cmd) == "alias" ]]; then + sf_cmd_type=$(type -t $sf_cmd) + if [[ $sf_cmd_type == "alias" ]]; then sf_cmd=$(alias $sf_cmd | sed -E "s/alias $sf_cmd='(.*)'/\1/") + elif [[ $sf_cmd_type == "file" ]]; then + sf_cmd=$(type -p $sf_cmd) fi - if [ ! -f "$sf_cmd" ]; then + if [[ $sf_cmd_type != "function" && ! -x $sf_cmd ]]; then return 1 fi local cur prev words cword _get_comp_words_by_ref -n := cur prev words cword - local completecmd=("$sf_cmd" "_complete" "-sbash" "-c$cword" "-S2.3.10") + local completecmd=("$sf_cmd" "_complete" "--no-interaction" "-sbash" "-c$cword" "-S2.5.5") for w in ${words[@]}; do w=$(printf -- '%b' "$w") # remove quotes from typed values diff --git a/composer-rpm.patch b/composer-rpm.patch index 5cfb149..85536c9 100644 --- a/composer-rpm.patch +++ b/composer-rpm.patch @@ -1,6 +1,6 @@ diff -up ./bin/composer.rpm ./bin/composer ---- ./bin/composer.rpm 2022-06-02 06:47:42.000000000 +0200 -+++ ./bin/composer 2022-06-02 06:49:45.037192985 +0200 +--- ./bin/composer.rpm 2023-03-21 15:42:18.000000000 +0100 ++++ ./bin/composer 2023-03-21 15:53:50.082632518 +0100 @@ -11,7 +11,7 @@ if (PHP_VERSION_ID < 70205) { } @@ -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 2022-06-02 06:47:42.000000000 +0200 -+++ ./src/Composer/Autoload/AutoloadGenerator.php 2022-06-02 06:49:45.037192985 +0200 -@@ -425,7 +425,7 @@ EOF; +--- ./src/Composer/Autoload/AutoloadGenerator.php.rpm 2023-03-21 15:42:18.000000000 +0100 ++++ ./src/Composer/Autoload/AutoloadGenerator.php 2023-03-21 15:53:50.082632518 +0100 +@@ -431,7 +431,7 @@ EOF; $filesystem->filePutContentsIfModified($targetDir.'/autoload_real.php', $this->getAutoloadRealFile(true, (bool) $includePathFileContents, $targetDirLoader, (bool) $includeFilesFileContents, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader, $checkPlatform)); $filesystem->safeCopy(__DIR__.'/ClassLoader.php', $targetDir.'/ClassLoader.php'); @@ -21,11 +21,11 @@ diff -up ./src/Composer/Autoload/AutoloadGenerator.php.rpm ./src/Composer/Autolo + $filesystem->safeCopy((getenv('BUILDROOT')?:'') . '/usr/share/composer/LICENSE', $targetDir.'/LICENSE'); if ($this->runScripts) { - $this->eventDispatcher->dispatchScript(ScriptEvents::POST_AUTOLOAD_DUMP, $this->devMode, array(), array( + $this->eventDispatcher->dispatchScript(ScriptEvents::POST_AUTOLOAD_DUMP, $this->devMode, [], [ diff -up ./src/Composer/Compiler.php.rpm ./src/Composer/Compiler.php ---- ./src/Composer/Compiler.php.rpm 2022-06-02 06:47:42.000000000 +0200 -+++ ./src/Composer/Compiler.php 2022-06-02 06:49:45.037192985 +0200 -@@ -107,7 +107,7 @@ class Compiler +--- ./src/Composer/Compiler.php.rpm 2023-03-21 15:42:18.000000000 +0100 ++++ ./src/Composer/Compiler.php 2023-03-21 15:53:50.082632518 +0100 +@@ -105,7 +105,7 @@ class Compiler // Add Composer resources $finder = new Finder(); $finder->files() @@ -35,8 +35,8 @@ diff -up ./src/Composer/Compiler.php.rpm ./src/Composer/Compiler.php ; foreach ($finder as $file) { diff -up ./src/Composer/InstalledVersions.php.rpm ./src/Composer/InstalledVersions.php ---- ./src/Composer/InstalledVersions.php.rpm 2022-06-02 06:47:42.000000000 +0200 -+++ ./src/Composer/InstalledVersions.php 2022-06-02 06:49:45.037192985 +0200 +--- ./src/Composer/InstalledVersions.php.rpm 2023-03-21 15:42:18.000000000 +0100 ++++ ./src/Composer/InstalledVersions.php 2023-03-21 15:55:07.748460545 +0100 @@ -266,7 +266,7 @@ class InstalledVersions if (null === self::$installed) { // only require the installed.php file if this file is loaded from its dumped location, @@ -46,19 +46,19 @@ diff -up ./src/Composer/InstalledVersions.php.rpm ./src/Composer/InstalledVersio self::$installed = include __DIR__ . '/installed.php'; } else { self::$installed = array(); -@@ -339,7 +339,7 @@ class InstalledVersions +@@ -341,7 +341,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(); + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require __DIR__ . '/installed.php'; + self::$installed = $required; diff -up ./src/Composer/Json/JsonFile.php.rpm ./src/Composer/Json/JsonFile.php ---- ./src/Composer/Json/JsonFile.php.rpm 2022-06-02 06:47:42.000000000 +0200 -+++ ./src/Composer/Json/JsonFile.php 2022-06-02 06:49:45.037192985 +0200 -@@ -39,7 +39,7 @@ class JsonFile +--- ./src/Composer/Json/JsonFile.php.rpm 2023-03-21 15:42:18.000000000 +0100 ++++ ./src/Composer/Json/JsonFile.php 2023-03-21 15:53:50.082632518 +0100 +@@ -40,7 +40,7 @@ class JsonFile /** @deprecated Use \JSON_UNESCAPED_UNICODE */ public const JSON_UNESCAPED_UNICODE = 256; @@ -67,7 +67,7 @@ diff -up ./src/Composer/Json/JsonFile.php.rpm ./src/Composer/Json/JsonFile.php /** @var string */ private $path; -@@ -219,7 +219,7 @@ class JsonFile +@@ -223,7 +223,7 @@ class JsonFile $isComposerSchemaFile = false; if (null === $schemaFile) { $isComposerSchemaFile = true; @@ -76,21 +76,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 ./src/Composer/PHPStan/ConfigReturnTypeExtension.php.rpm ./src/Composer/PHPStan/ConfigReturnTypeExtension.php ---- ./src/Composer/PHPStan/ConfigReturnTypeExtension.php.rpm 2022-06-02 06:50:28.987916014 +0200 -+++ ./src/Composer/PHPStan/ConfigReturnTypeExtension.php 2022-06-02 06:51:05.429709332 +0200 -@@ -30,7 +30,7 @@ final class ConfigReturnTypeExtension im - - public function __construct() - { -- $schema = JsonFile::parseJson((string) file_get_contents(__DIR__.'/../../../res/composer-schema.json')); -+ $schema = JsonFile::parseJson((string) file_get_contents('/usr/share/composer/res/composer-schema.json')); - /** - * @var string $prop - */ diff -up ./src/Composer/vendor/composer/ca-bundle/src/CaBundle.php.rpm ./src/Composer/vendor/composer/ca-bundle/src/CaBundle.php ---- ./src/Composer/vendor/composer/ca-bundle/src/CaBundle.php.rpm 2022-05-24 13:56:16.000000000 +0200 -+++ ./src/Composer/vendor/composer/ca-bundle/src/CaBundle.php 2022-06-02 06:49:45.037192985 +0200 +--- ./src/Composer/vendor/composer/ca-bundle/src/CaBundle.php.rpm 2023-01-11 09:27:00.000000000 +0100 ++++ ./src/Composer/vendor/composer/ca-bundle/src/CaBundle.php 2023-03-21 15:53:50.083632516 +0100 @@ -125,7 +125,7 @@ class CaBundle */ public static function getBundledCaBundlePath() @@ -100,16 +88,3 @@ diff -up ./src/Composer/vendor/composer/ca-bundle/src/CaBundle.php.rpm ./src/Com // cURL does not understand 'phar://' paths // see https://github.com/composer/ca-bundle/issues/10 -diff -up ./tests/Composer/Test/Json/ComposerSchemaTest.php.rpm ./tests/Composer/Test/Json/ComposerSchemaTest.php ---- ./tests/Composer/Test/Json/ComposerSchemaTest.php.rpm 2022-06-02 06:47:42.000000000 +0200 -+++ ./tests/Composer/Test/Json/ComposerSchemaTest.php 2022-06-02 06:49:45.037192985 +0200 -@@ -97,7 +97,8 @@ class ComposerSchemaTest extends TestCas - private function check(string $json) - { - $validator = new Validator(); -- $validator->check(json_decode($json), (object) array('$ref' => 'file://' . __DIR__ . '/../../../../res/composer-schema.json')); -+ $f = (getenv('BUILDROOT')?:'') . '/usr/share/composer/res/composer-schema.json'; -+ $validator->check(json_decode($json), (object) array('$ref' => 'file://' . $f)); - - if (!$validator->isValid()) { - $errors = $validator->getErrors(); diff --git a/composer.spec b/composer.spec index b252516..698367b 100644 --- a/composer.spec +++ b/composer.spec @@ -1,7 +1,7 @@ # remirepo/fedora spec file for composer # -# Copyright (c) 2015-2022 Remi Collet -# License: CC-BY-SA +# Copyright (c) 2015-2023 Remi Collet +# License: CC-BY-SA-4.0 # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries @@ -10,15 +10,7 @@ # For compatibility with SCL %undefine __brp_mangle_shebangs -%if 0 -%bcond_without tests -%bcond_without syslib -%else -%bcond_with tests -%bcond_with syslib -%endif - -%global gh_commit ebac357c0a41359f3981098729042ed6dedc97ba +%global gh_commit c7cffaad16a60636a776017eac5bd8cd0095c32f %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_branch 2.0-dev %global gh_owner composer @@ -26,13 +18,9 @@ %global api_version 2.3.0 %global run_version 2.2.2 -%global upstream_version 2.3.10 -#global upstream_prever RC2 -#global upstream_lower rc2 - -%global symfony_prefix php-symfony5 -%global symfony_path %{_datadir}/php/Symfony5 -%global symfony_min 5.4.1 +%global upstream_version 2.5.5 +#global upstream_prever RC1 +#global upstream_lower rc1 %global _phpunit %{_bindir}/phpunit9 %global bashcompdir %(pkg-config --variable=completionsdir bash-completion 2>/dev/null) @@ -44,7 +32,7 @@ Version: %{upstream_version}%{?upstream_prever:~%{upstream_lower}} Release: 1%{?dist} Summary: Dependency Manager for PHP -# composer and all dependencies are MIT +# SPDX: composer and all dependencies are MIT License: MIT URL: https://getcomposer.org/ Source0: %{gh_project}-%{upstream_version}%{?upstream_prever}-%{gh_short}.tgz @@ -66,30 +54,6 @@ BuildRequires: php(language) >= 7.2.5 BuildRequires: php-cli BuildRequires: php-json BuildRequires: pkgconfig(bash-completion) -%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) >= 2.0.2 with php-composer(composer/xdebug-handler) < 4) -BuildRequires: (php-composer(seld/jsonlint) >= 1.4 with php-composer(seld/jsonlint) < 2) -BuildRequires: (php-composer(seld/phar-utils) >= 1.2 with php-composer(seld/phar-utils) < 2) -BuildRequires: (php-composer(psr/log) >= 1.1 with php-composer(psr/log) < 4) -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) -BuildRequires: (php-composer(composer/pcre) >= 2 with php-composer(composer/pcre) < 4) -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 || ^6.0", -# "phpspec/prophecy": "^1.10" -BuildRequires: %{_phpunit} -# For autoloader -BuildRequires: php-fedora-autoloader-devel -%endif # From composer.json, "require": { # "php": "^7.2.5 || ^8.0", @@ -112,32 +76,14 @@ BuildRequires: php-fedora-autoloader-devel # "symfony/polyfill-php80": "^1.24" Requires: php(language) >= 7.2.5 Requires: php-cli -%if %{with syslib} -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) >= 2.0.2 with php-composer(composer/xdebug-handler) < 4) -Requires: (php-composer(seld/jsonlint) >= 1.4 with php-composer(seld/jsonlint) < 2) -Requires: (php-composer(seld/phar-utils) >= 1.2 with php-composer(seld/phar-utils) < 2) -Requires: (php-composer(psr/log) >= 1.1 with php-composer(psr/log) < 4) -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) -Requires: (php-composer(composer/pcre) >= 2 with php-composer(composer/pcre) < 4) -Requires: %{symfony_prefix}-console >= %{symfony_min} -Requires: %{symfony_prefix}-finder >= %{symfony_min} -Requires: %{symfony_prefix}-process >= %{symfony_min} -Requires: %{symfony_prefix}-filesystem >= %{symfony_min} -# For our autoloader -Requires: php-composer(fedora/autoloader) -%else # System certificates Requires: ca-certificates # Bundled libraries # License MIT -Provides: bundled(php-composer-ca-bundle) = 1.3.2 +Provides: bundled(php-composer-ca-bundle) = 1.3.5 +Provides: bundled(php-composer-class-map-generator) = 1.0.0 Provides: bundled(php-composer-metadata-minifier) = 1.0.0 -Provides: bundled(php-composer-pcre) = 2.0.0 +Provides: bundled(php-composer-pcre) = 2.1.0 Provides: bundled(php-composer-semver) = 3.3.2 Provides: bundled(php-composer-spdx-licenses) = 1.5.7 Provides: bundled(php-composer-xdebug-handler) = 3.0.3 @@ -146,21 +92,23 @@ Provides: bundled(php-psr-container) = 1.1.1 Provides: bundled(php-psr-log) = 1.1.4 Provides: bundled(php-react-promise) = v2.9.0 Provides: bundled(php-seld-jsonlint) = 1.9.0 -Provides: bundled(php-seld-phar-utils) = 1.2.0 -Provides: bundled(php-symfony-console) = v5.4.10 +Provides: bundled(php-seld-phar-utils) = 1.2.1 +Provides: bundled(php-seld-signal-handler) = 2.0.1 +Provides: bundled(php-symfony-console) = v5.4.21 Provides: bundled(php-symfony-deprecation-contracts) = v2.5.2 -Provides: bundled(php-symfony-filesystem) = v5.4.9 -Provides: bundled(php-symfony-finder) = v5.4.8 -Provides: bundled(php-symfony-polyfill-ctype) = v1.26.0 -Provides: bundled(php-symfony-polyfill-intl-grapheme) = v1.26.0 -Provides: bundled(php-symfony-polyfill-intl-normalizer) = v1.26.0 -Provides: bundled(php-symfony-polyfill-mbstring) = v1.26.0 -Provides: bundled(php-symfony-polyfill-php73) = v1.26.0 -Provides: bundled(php-symfony-polyfill-php80) = v1.26.0 -Provides: bundled(php-symfony-process) = v5.4.8 +Provides: bundled(php-symfony-filesystem) = v5.4.21 +Provides: bundled(php-symfony-finder) = v5.4.21 +Provides: bundled(php-symfony-polyfill-ctype) = v1.27.0 +Provides: bundled(php-symfony-polyfill-intl-grapheme) = v1.27.0 +Provides: bundled(php-symfony-polyfill-intl-normalizer) = v1.27.0 +Provides: bundled(php-symfony-polyfill-mbstring) = v1.27.0 +Provides: bundled(php-symfony-polyfill-php73) = v1.27.0 +Provides: bundled(php-symfony-polyfill-php80) = v1.27.0 +Provides: bundled(php-symfony-polyfill-php81) = v1.27.0 +Provides: bundled(php-symfony-process) = v5.4.21 Provides: bundled(php-symfony-service-contracts) = v2.5.2 -Provides: bundled(php-symfony-string) = v5.4.10 -%endif +Provides: bundled(php-symfony-string) = v5.4.21 + # 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", @@ -219,47 +167,6 @@ fi rm src/bootstrap.php rm src/Composer/vendor/composer/ca-bundle/res/cacert.pem -%if %{with syslib} -rm -rf src/Composer/vendor - -phpab --template fedora --output src/Composer/autoload.php src/Composer -cat << 'EOF' | tee -a src/Composer/autoload.php - -\Fedora\Autoloader\Dependencies::required([ - [ /* before symfony which load composer */ - '%{_datadir}/php/Composer/XdebugHandler3/autoload.php', - '%{_datadir}/php/Composer/XdebugHandler2/autoload.php', - ], - '%{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/MetadataMinifier/autoload.php', - '%{_datadir}/php/Composer/Semver3/autoload.php', - [ - '%{_datadir}/php/Composer/Pcre3/autoload.php', - '%{_datadir}/php/Composer/Pcre2/autoload.php', - ], [ - '%{_datadir}/php/Psr/Log3/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', -]); -EOF - -cat << 'EOF' | tee tests/bootstrap.php - - 2.5.5-1 +- update to 2.5.5 + +* Wed Feb 15 2023 Remi Collet - 2.5.4-1 +- update to 2.5.4 + +* Fri Feb 10 2023 Remi Collet - 2.5.3-1 +- update to 2.5.3 + +* Mon Feb 6 2023 Remi Collet - 2.5.2-1 +- update to 2.5.2 + +* Thu Dec 22 2022 Remi Collet - 2.5.1-1 +- update to 2.5.1 + +* Tue Dec 20 2022 Remi Collet - 2.5.0-1 +- update to 2.5.0 + +* Fri Oct 28 2022 Remi Collet - 2.4.4-1 +- update to 2.4.4 + +* Sat Oct 15 2022 Remi Collet - 2.4.3-1 +- update to 2.4.3 + +* Thu Sep 15 2022 Remi Collet - 2.4.2-1 +- update to 2.4.2 + +* Mon Aug 29 2022 Remi Collet - 2.4.1-1 +- update to 2.4.1 + +* Tue Aug 16 2022 Remi Collet - 2.4.0-1 +- update to 2.4.0 + * Thu Jul 14 2022 Remi Collet - 2.3.10-1 - update to 2.3.10 diff --git a/sources b/sources index 038e012..c649148 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (composer-2.3.10-ebac357.tgz) = 22302bfb5bb03f87567eda1fcfe906b049d43ff43862472405d13f6af472b1452834d09cb944753b740950c2d98911e6af72bb7b771c048a26cdb165b0c73659 +SHA512 (composer-2.5.5-c7cffaa.tgz) = 0b0bfc68bc39b74dc3031cd9d24403fb958adb3e311cf0152c16b80c4cfac28de008d2fcca985213d0e6b7979e7decc0f2ea59e98293d7f33fa224ed364f4476