summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2021-05-31 15:57:19 +0200
committerRemi Collet <remi@remirepo.net>2021-05-31 15:57:19 +0200
commit20d88c6908557b0f060c93afff4034c10a8a5730 (patch)
tree1124d1d1ca359a30b3dbf5d7a44c1f484cc3eed1
parent0ed6f6223b30413a8acfd5d195ed29fdcc50659a (diff)
disable XDG directories usage, see #1955455
-rw-r--r--composer-noxdg.patch14
-rw-r--r--composer.spec10
2 files changed, 22 insertions, 2 deletions
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.spec b/composer.spec
index 0dc3545..1352c44 100644
--- a/composer.spec
+++ b/composer.spec
@@ -39,7 +39,7 @@
Name: composer
Version: %{upstream_version}%{?upstream_prever:~%{upstream_lower}}
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Dependency Manager for PHP
License: MIT
@@ -53,6 +53,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
@@ -190,7 +192,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
@@ -327,6 +330,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