From fd37853159fabb13e89055b53dc51a73ebb7b1de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 1 Aug 2024 18:49:51 +0200 Subject: [PATCH] Separate patches for wheel from other sources, apply them only --without rpmwheels --- python3.6.spec | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/python3.6.spec b/python3.6.spec index 4d348bd..007f80d 100644 --- a/python3.6.spec +++ b/python3.6.spec @@ -320,8 +320,10 @@ Source10: idle3.desktop # AppData file for idle3 Source11: idle3.appdata.xml +# Patches for bundled wheels + # Patch for the bundled pip wheel for CVE-2007-4559 -Source12: pip-CVE-2007-4559.patch +Source101: pip-CVE-2007-4559.patch # (Patches taken from github.com/fedora-python/cpython) @@ -1068,17 +1070,17 @@ or older Fedora releases. %if %{with rpmwheels} %autopatch 189 rm Lib/ensurepip/_bundled/*.whl +%else +# Patch the bundled pip wheel for CVE-2007-4559 +unzip -qq Lib/ensurepip/_bundled/pip-%{pip_version}-py2.py3-none-any.whl +patch -p1 < %{SOURCE101} +zip -rq Lib/ensurepip/_bundled/pip-%{pip_version}-py2.py3-none-any.whl pip pip-%{pip_version}.dist-info +rm -rf pip/ pip-%{pip_version}.dist-info/ %endif # Apply the remaining patches %autopatch -m 190 -# Patch the bundled pip wheel for CVE-2007-4559 -unzip -qq Lib/ensurepip/_bundled/pip-%{pip_version}-py2.py3-none-any.whl -patch -p1 < %{SOURCE12} -zip -rq Lib/ensurepip/_bundled/pip-%{pip_version}-py2.py3-none-any.whl pip pip-%{pip_version}.dist-info -rm -rf pip/ pip-%{pip_version}.dist-info/ - # Remove bundled libraries to ensure that we're using the system copy. rm -r Modules/expat rm -r Modules/zlib