diff --git a/00178-dont-duplicate-flags-in-sysconfig.patch b/00178-dont-duplicate-flags-in-sysconfig.patch deleted file mode 100644 index 75f3546888c64c1b62222134455edfdc9db23f7c..0000000000000000000000000000000000000000 --- a/00178-dont-duplicate-flags-in-sysconfig.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py -index 3414a76..5cb3a89 100644 ---- a/Lib/distutils/sysconfig.py -+++ b/Lib/distutils/sysconfig.py -@@ -146,7 +146,10 @@ def parse_makefile(fn, g=None): - done[n] = item = "" - if found: - after = value[m.end():] -- value = value[:m.start()] + item + after -+ value = value[:m.start()] -+ if item.strip() not in value: -+ value += item -+ value += after - if "$" in after: - notdone[name] = value - else: -diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py -index 95b48f6..90b4e27 100644 ---- a/Lib/sysconfig.py -+++ b/Lib/sysconfig.py -@@ -346,7 +346,10 @@ def _parse_makefile(filename, vars=None, keep_unresolved=True): - - if found: - after = value[m.end():] -- value = value[:m.start()] + item + after -+ value = value[:m.start()] -+ if item.strip() not in value: -+ value += item -+ value += after - if "$" in after: - notdone[name] = value - else: --- -1.8.3.1 - diff --git a/00205-make-libpl-respect-lib64.patch b/00205-make-libpl-respect-lib64.patch deleted file mode 100644 index 95414f0d191870cc735de7002e726a4ccb466b4d..0000000000000000000000000000000000000000 --- a/00205-make-libpl-respect-lib64.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/Makefile.pre.in b/Makefile.pre.in -index 790d974..2e25366 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -1689,7 +1689,7 @@ inclinstall: - - # Install the library and miscellaneous stuff needed for extending/embedding - # This goes into $(exec_prefix) --LIBPL= @LIBPL@ -+LIBPL= $(LIBDEST)/config-$(LDVERSION)-$(MULTIARCH) - - # pkgconfig directory - LIBPC= $(LIBDIR)/pkgconfig --- -1.8.3.1 - diff --git a/00251-change-user-install-location.patch b/00251-change-user-install-location.patch index 623cc6fcea8595fef858c31dbc31098ab5c179d7..ac6901d62e51bc7a3498e4d0ce598a6585a616b3 100644 --- a/00251-change-user-install-location.patch +++ b/00251-change-user-install-location.patch @@ -1,34 +1,42 @@ -diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py -index 26696cf..1826cbc 100644 ---- a/Lib/distutils/command/install.py -+++ b/Lib/distutils/command/install.py -@@ -441,8 +441,19 @@ class install(Command): - raise DistutilsOptionError( - "must not supply exec-prefix without prefix") - -- self.prefix = os.path.normpath(sys.prefix) -- self.exec_prefix = os.path.normpath(sys.exec_prefix) -+ # self.prefix is set to sys.prefix + /local/ -+ # if neither RPM build nor virtual environment is -+ # detected to make pip and distutils install packages -+ # into the separate location. -+ if (not (hasattr(sys, 'real_prefix') or -+ sys.prefix != sys.base_prefix) and -+ 'RPM_BUILD_ROOT' not in os.environ): -+ addition = "/local" -+ else: -+ addition = "" -+ -+ self.prefix = os.path.normpath(sys.prefix) + addition -+ self.exec_prefix = os.path.normpath(sys.exec_prefix) + addition - - else: - if self.exec_prefix is None: +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Lumir Balhar +Date: Mon, 15 Feb 2021 12:19:27 +0100 +Subject: [PATCH] 00251: Change user install location +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Change the values of sysconfig's "posix_prefix" install scheme to /usr/local +when RPM build or venv/virtualenv is not detected, +to make pip, sysconfig and distutils install into an isolated location. + +The original values are saved as an additional "rpm_prefix" install scheme. + +The site module adds the /usr/local paths to sys.path when site packages are +enabled and RPM build is not detected. + +Fedora Change: https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe + +Rewrote in Fedora 36+ to patch sysconfig instead of distutils, +see https://discuss.python.org/t/pep-632-deprecate-distutils-module/5134/104 + +Downstream only for now, waiting for https://bugs.python.org/issue43976 + +Co-authored-by: Petr Viktorin +Co-authored-by: Miro Hrončok +Co-authored-by: Michal Cyprian +Co-authored-by: Lumír Balhar +--- + Lib/site.py | 9 ++++++++- + Lib/sysconfig.py | 25 +++++++++++++++++++++++++ + Lib/test/test_sysconfig.py | 4 +++- + 3 files changed, 36 insertions(+), 2 deletions(-) + diff --git a/Lib/site.py b/Lib/site.py -index 939893e..9bc1a5f 100644 +index 939893eb5e..d1316c3355 100644 --- a/Lib/site.py +++ b/Lib/site.py -@@ -380,7 +380,14 @@ def getsitepackages(prefixes=None): +@@ -380,8 +380,15 @@ def getsitepackages(prefixes=None): return sitepackages def addsitepackages(known_paths, prefixes=None): @@ -39,11 +47,67 @@ index 939893e..9bc1a5f 100644 + to make packages installed into this location visible. + + """ + _trace("Processing global site-packages") + if ENABLE_USER_SITE and 'RPM_BUILD_ROOT' not in os.environ: + PREFIXES.insert(0, "/usr/local") - _trace("Processing global site-packages") for sitedir in getsitepackages(prefixes): if os.path.isdir(sitedir): --- -1.8.3.1 - + addsitedir(sitedir, known_paths) +diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py +index daf9f00006..40e4edf0ae 100644 +--- a/Lib/sysconfig.py ++++ b/Lib/sysconfig.py +@@ -58,6 +58,31 @@ + }, + } + ++# backup the original posix_prefix as rpm_prefix ++# RPM packages use it and we need to be able to read it even when changed ++_INSTALL_SCHEMES['rpm_prefix'] = _INSTALL_SCHEMES['posix_prefix'] ++# Virtualenv >= 20.10.0 favors the "venv" scheme over the defaults when creating virtual environments. ++# See: https://github.com/pypa/virtualenv/commit/8da79db86d8a5c74d03667a40e64ff832076445e ++# See: https://bugs.python.org/issue45413 ++# "venv" should be the same as the unpatched posix_prefix for us, ++# so new virtual environments aren't created with paths like venv/local/bin/python. ++_INSTALL_SCHEMES['venv'] = _INSTALL_SCHEMES['posix_prefix'] ++ ++if (not (hasattr(sys, 'real_prefix') or ++ sys.prefix != sys.base_prefix) and ++ 'RPM_BUILD_ROOT' not in os.environ): ++ _INSTALL_SCHEMES['posix_prefix'] = { ++ 'stdlib': '{installed_base}/{platlibdir}/python{py_version_short}', ++ 'platstdlib': '{platbase}/{platlibdir}/python{py_version_short}', ++ 'purelib': '{base}/local/lib/python{py_version_short}/site-packages', ++ 'platlib': '{platbase}/local/{platlibdir}/python{py_version_short}/site-packages', ++ 'include': ++ '{installed_base}/include/python{py_version_short}{abiflags}', ++ 'platinclude': ++ '{installed_platbase}/include/python{py_version_short}{abiflags}', ++ 'scripts': '{base}/local/bin', ++ 'data': '{base}/local', ++ } + + # NOTE: site.py has copy of this function. + # Sync it when modify this function. +diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py +index 9408657c91..fd49b2bcce 100644 +--- a/Lib/test/test_sysconfig.py ++++ b/Lib/test/test_sysconfig.py +@@ -263,7 +263,7 @@ def test_get_config_h_filename(self): + self.assertTrue(os.path.isfile(config_h), config_h) + + def test_get_scheme_names(self): +- wanted = ['nt', 'posix_home', 'posix_prefix'] ++ wanted = ['nt', 'posix_home', 'posix_prefix', 'rpm_prefix', 'venv'] + if HAS_USER_BASE: + wanted.extend(['nt_user', 'osx_framework_user', 'posix_user']) + self.assertEqual(get_scheme_names(), tuple(sorted(wanted))) +@@ -274,6 +274,8 @@ def test_symlink(self): # Issue 7880 + cmd = "-c", "import sysconfig; print(sysconfig.get_platform())" + self.assertEqual(py.call_real(*cmd), py.call_link(*cmd)) + ++ @unittest.skipIf('RPM_BUILD_ROOT' not in os.environ, ++ "Test doesn't expect Fedora's paths") + def test_user_similar(self): + # Issue #8759: make sure the posix scheme for the users + # is similar to the global posix_prefix one diff --git a/Python-3.10.0.tar.xz b/Python-3.10.2.tar.xz similarity index 67% rename from Python-3.10.0.tar.xz rename to Python-3.10.2.tar.xz index 9059b7936c45e49333bd9309c0ec74c4a7a19fed..c35c1fc12a86bbc9b3c7242a28489bacf2d52675 100644 Binary files a/Python-3.10.0.tar.xz and b/Python-3.10.2.tar.xz differ diff --git a/backport-bpo-46811-Make-test-suite-support-Expat-2.4.5.patch b/backport-bpo-46811-Make-test-suite-support-Expat-2.4.5.patch index d77007bd351943eeab6e2b4208b660ea1651f170..cfa56e6e5bf629987cf7e0ab74fdf0160059a89e 100644 --- a/backport-bpo-46811-Make-test-suite-support-Expat-2.4.5.patch +++ b/backport-bpo-46811-Make-test-suite-support-Expat-2.4.5.patch @@ -76,10 +76,10 @@ index 1663b1f..9762025 100644 def testDocRemoveChild(self): diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py -index 553529a..49f8112 100644 +index 285559a..4bd4291 100644 --- a/Lib/test/test_xml_etree.py +++ b/Lib/test/test_xml_etree.py -@@ -2186,12 +2186,6 @@ class BugsTest(unittest.TestCase): +@@ -2183,12 +2183,6 @@ class BugsTest(unittest.TestCase): b"\n" b'tãg') diff --git a/python3.spec b/python3.spec index f727e13776b60d9c36500aac38631cfac363e746..ce9b66798ad0ca8d35447adf11d473b6a09984a2 100644 --- a/python3.spec +++ b/python3.spec @@ -2,8 +2,8 @@ Name: python3 Summary: Interpreter of the Python3 programming language URL: https://www.python.org/ -Version: 3.10.0 -Release: 4 +Version: 3.10.2 +Release: 1 License: Python %global branchversion 3.10 @@ -86,8 +86,6 @@ Source: https://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz Source1: pyconfig.h Patch1: 00001-rpath.patch -Patch178: 00178-dont-duplicate-flags-in-sysconfig.patch -Patch205: 00205-make-libpl-respect-lib64.patch Patch251: 00251-change-user-install-location.patch Patch6000: backport-bpo-46811-Make-test-suite-support-Expat-2.4.5.patch @@ -175,7 +173,7 @@ rm Lib/ensurepip/_bundled/*.whl rm configure pyconfig.h.in %patch1 -p1 -%patch178 -p1 +%patch251 -p1 %patch6000 -p1 %patch9000 -p1 @@ -795,6 +793,12 @@ export BEP_GTDLIST="$BEP_GTDLIST_TMP" %{_mandir}/*/* %changelog +* Wed Mar 09 2022 shixuantong - 3.10.2-1 +- Type:enhancement +- CVE:NA +- SUG:NA +- DESC:update version to 3.10.2 + * Mon Mar 07 2022 shixuantong - 3.10.0-4 - Type:bugfix - CVE:NA