disable XDG directories usage, see #1955455

(cherry picked from commit ce36f5cbc0)
This commit is contained in:
Remi Collet 2021-05-31 15:59:44 +02:00
commit 18f9adbd01
2 changed files with 22 additions and 2 deletions

14
composer-noxdg.patch Normal file
View file

@ -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;

View file

@ -31,7 +31,7 @@
Name: composer
Version: %{upstream_version}%{?upstream_prever:~%{upstream_lower}}
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Dependency Manager for PHP
License: MIT
@ -45,6 +45,8 @@ 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
@ -182,7 +184,8 @@ Documentation: https://getcomposer.org/doc/
%setup -q -n %{gh_project}-%{gh_commit}
%patch0 -p1 -b .rpm
find . -name \*.rpm -delete -print
%patch1 -p1 -b .noxdg
find . \( -name \*.rpm -o -name \*noxdg \) -delete -print
if grep -r '\.\./res'; then
: Patch need to fixed
@ -319,6 +322,9 @@ exit $ret
%changelog
* Mon May 31 2021 Remi Collet <remi@remirepo.net> - 2.0.14-2
- disable XDG directories usage, see #1955455
* Sat May 22 2021 Remi Collet <remi@remirepo.net> - 2.0.14-1
- update to 2.0.14
- switch to composer/xdebug-handler v2