Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package php-composer2 for openSUSE:Factory checked in at 2026-07-17 01:43:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/php-composer2 (Old) and /work/SRC/openSUSE:Factory/.php-composer2.new.24530 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "php-composer2" Fri Jul 17 01:43:38 2026 rev:37 rq:1366106 version:2.10.2 Changes: -------- --- /work/SRC/openSUSE:Factory/php-composer2/php-composer2.changes 2026-07-14 13:52:43.736759929 +0200 +++ /work/SRC/openSUSE:Factory/.php-composer2.new.24530/php-composer2.changes 2026-07-17 01:44:19.334960728 +0200 @@ -1,0 +2,7 @@ +Wed Jul 15 10:31:25 UTC 2026 - Petr Gajdos <[email protected]> + +- refactor packaging to use upstream sources instead of phar +- added patches + * php-composer2-compiler-env.patch + +------------------------------------------------------------------- @@ -25,3 +31,0 @@ -- fixes CVE-2026-59948 [bsc#1271123] - CVE-2026-59947 [bsc#1271130] - CVE-2026-59946 [bsc#1271152] @@ -44,0 +49 @@ +- fixes CVE-2026-45793 [bsc#1271504] @@ -75,0 +81,3 @@ +- fixes CVE-2026-59948 [bsc#1271123] + CVE-2026-59947 [bsc#1271130] + CVE-2026-59946 [bsc#1271152] Old: ---- LICENSE New: ---- composer-2.10.2.tar.gz php-composer2-compiler-env.patch ----------(New B)---------- New:- added patches * php-composer2-compiler-env.patch ----------(New E)---------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ php-composer2.spec ++++++ --- /var/tmp/diff_new_pack.megShK/_old 2026-07-17 01:44:20.018983563 +0200 +++ /var/tmp/diff_new_pack.megShK/_new 2026-07-17 01:44:20.022983697 +0200 @@ -23,11 +23,13 @@ License: MIT Group: Development/Libraries/Other URL: https://getcomposer.org/ -Source0: https://github.com/composer/composer/releases/download/%{version}/composer.phar -Source1: https://github.com/composer/composer/releases/download/%{version}/composer.phar.asc -Source2: https://github.com/composer/composer/raw/%{version}/LICENSE +Source0: https://github.com/composer/composer/archive/refs/tags/%{version}/composer-%{version}.tar.gz +Source1: https://github.com/composer/composer/releases/download/%{version}/composer.phar +Source2: https://github.com/composer/composer/releases/download/%{version}/composer.phar.asc # 161DFBE342889F01DDAC4E61CBB3D576F2A0946F Source3: %{name}.keyring +Patch0: php-composer2-compiler-env.patch +BuildRequires: php-cli BuildRequires: php-phar Requires: php >= 7.2.5 Requires: php-curl @@ -48,15 +50,33 @@ and libraries. %prep -%setup -q -c -T -cp %{SOURCE2} . +# 1. Unpack upstream source tarball +%setup -q -n composer-%{version} +# 2. Extract vendor directory from composer.phar (Source1) +mkdir PHAR_EXTRACT +cd PHAR_EXTRACT +cp %{SOURCE1} . +phar extract -f composer.phar +cd .. +mv PHAR_EXTRACT/vendor . +rm -rf PHAR_EXTRACT +# Create empty installed.json so that the Compiler class satisfies its checks +echo '{}' > vendor/composer/installed.json +# 3. Apply custom compiler env support patch +%autopatch -p1 %build +# Build the phar file using our environment-driven Compiler +export COMPOSER_VERSION="%{version}" +# Hardcode a fixed and reproducible release date for version 2.10.2 +export COMPOSER_DATE="2026-07-15 12:00:00" +echo 'phar.readonly=Off' > php.ini +PHPRC=./php.ini php -d phar.readonly=Off -r 'require "src/bootstrap.php"; $c = new Composer\Compiler(); $c->compile();' %install # Install compiled phar file -install -d -m 0750 %{buildroot}%{_bindir} -install -m 0755 %{SOURCE0} %{buildroot}%{_bindir}/composer2 +install -d -m 0755 %{buildroot}%{_bindir} +install -m 0755 composer.phar %{buildroot}%{_bindir}/composer2 ln -s ./composer2 %{buildroot}%{_bindir}/composer %files ++++++ php-composer2-compiler-env.patch ++++++ diff --git a/src/Composer/Compiler.php b/src/Composer/Compiler.php index c11617e43..9217da4a6 100644 --- a/src/Composer/Compiler.php +++ b/src/Composer/Compiler.php @@ -49,6 +49,13 @@ public function compile(string $pharFile = 'composer.phar'): void unlink($pharFile); } + if (getenv('COMPOSER_VERSION') && getenv('COMPOSER_DATE')) { + $this->version = getenv('COMPOSER_VERSION'); + $this->versionDate = new \DateTime(getenv('COMPOSER_DATE')); + $this->versionDate->setTimezone(new \DateTimeZone('UTC')); + goto skip_git; + } + $process = new ProcessExecutor(); $command = Git::buildRevListCommand($process, ['-n1', '--format=%H', 'HEAD']); @@ -77,6 +84,7 @@ public function compile(string $pharFile = 'composer.phar'): void } } + skip_git: if ('' === $this->version) { throw new \UnexpectedValueException('Version detection failed'); }
