diff -Nru python3.10-3.10.2/debian/changelog python3.10-3.10.2/debian/changelog --- python3.10-3.10.2/debian/changelog 2022-01-16 17:11:27.000000000 +0000 +++ python3.10-3.10.2/debian/changelog 2022-02-14 11:09:41.000000000 +0000 @@ -1,3 +1,10 @@ +python3.10 (3.10.2-1ubuntu1~ppa0) jammy; urgency=medium + + * debian/patches: + + Rebase sysconfig-debian-schemes.diff to fix LP: #1960608 + + -- Alexandre Ghiti Mon, 14 Feb 2022 12:09:41 +0100 + python3.10 (3.10.2-1) unstable; urgency=medium * Python 3.10.1 release. diff -Nru python3.10-3.10.2/debian/control python3.10-3.10.2/debian/control --- python3.10-3.10.2/debian/control 2022-01-16 15:55:46.000000000 +0000 +++ python3.10-3.10.2/debian/control 2022-02-14 11:09:41.000000000 +0000 @@ -1,7 +1,8 @@ Source: python3.10 Section: python Priority: optional -Maintainer: Matthias Klose +Maintainer: Ubuntu Core Developers +XSBC-Original-Maintainer: Matthias Klose Build-Depends: debhelper (>= 11), dpkg-dev (>= 1.17.11), quilt, autoconf, lsb-release, sharutils, diff -Nru python3.10-3.10.2/debian/patches/NEW-sysconfig-debian-schemes.diff python3.10-3.10.2/debian/patches/NEW-sysconfig-debian-schemes.diff --- python3.10-3.10.2/debian/patches/NEW-sysconfig-debian-schemes.diff 1970-01-01 00:00:00.000000000 +0000 +++ python3.10-3.10.2/debian/patches/NEW-sysconfig-debian-schemes.diff 2022-02-14 11:09:14.000000000 +0000 @@ -0,0 +1,84 @@ +--- a/Lib/sysconfig.py ++++ b/Lib/sysconfig.py +@@ -36,6 +36,30 @@ + 'scripts': '{base}/bin', + 'data': '{base}', + }, ++ 'deb_system': { ++ 'stdlib': '{installed_base}/lib/python{py_version_short}', ++ 'platstdlib': '{platbase}/lib/python{py_version_short}', ++ 'purelib': '{base}/lib/python3/dist-packages', ++ 'platlib': '{platbase}/lib/python3/dist-packages', ++ 'include': ++ '{installed_base}/include/python{py_version_short}{abiflags}', ++ 'platinclude': ++ '{installed_platbase}/include/python{py_version_short}{abiflags}', ++ 'scripts': '{base}/bin', ++ 'data': '{base}', ++ }, ++ 'posix_local': { ++ 'stdlib': '{installed_base}/lib/python{py_version_short}', ++ 'platstdlib': '{platbase}/lib/python{py_version_short}', ++ 'purelib': '{base}/local/lib/python{py_version_short}/dist-packages', ++ 'platlib': '{platbase}/local/lib/python{py_version_short}/dist-packages', ++ 'include': ++ '{installed_base}/local/include/python{py_version_short}{abiflags}', ++ 'platinclude': ++ '{installed_platbase}/local/include/python{py_version_short}{abiflags}', ++ 'scripts': '{base}/local/bin', ++ 'data': '{base}', ++ }, + 'posix_home': { + 'stdlib': '{installed_base}/lib/python', + 'platstdlib': '{base}/lib/python', +@@ -183,7 +207,7 @@ + _PYTHON_BUILD = is_python_build(True) + + if _PYTHON_BUILD: +- for scheme in ('posix_prefix', 'posix_home'): ++ for scheme in ('posix_prefix', 'posix_home', 'posix_local', 'deb_system'): + # On POSIX-y platforms, Python will: + # - Build from .h files in 'headers' (which is only added to the + # scheme when building CPython) +@@ -237,8 +261,20 @@ + 'home': 'posix_home', + 'user': 'osx_framework_user', + } ++ ++ if 'real_prefix' in sys.__dict__ or 'VIRTUAL_ENV' in os.environ: ++ # virtual environments ++ prefix_scheme = 'posix_prefix' ++ else: ++ # default to /usr for package builds, /usr/local otherwise ++ deb_build = os.environ.get('DEB_PYTHON_INSTALL_LAYOUT', 'posix_local') ++ if deb_build in ('deb', 'deb_system'): ++ prefix_scheme = 'deb_system' ++ else: ++ prefix_scheme = 'posix_local' ++ + return { +- 'prefix': 'posix_prefix', ++ 'prefix': prefix_scheme, + 'home': 'posix_home', + 'user': 'posix_user', + } +@@ -538,7 +574,7 @@ + else: + inc_dir = _sys_home or _PROJECT_BASE + else: +- inc_dir = get_path('platinclude') ++ inc_dir = get_path('platinclude', 'posix_prefix') + return os.path.join(inc_dir, 'pyconfig.h') + + +--- a/Lib/test/test_sysconfig.py ++++ b/Lib/test/test_sysconfig.py +@@ -263,7 +263,7 @@ + self.assertTrue(os.path.isfile(config_h), config_h) + + def test_get_scheme_names(self): +- wanted = ['nt', 'posix_home', 'posix_prefix'] ++ wanted = ['deb_system', 'nt', 'posix_home', 'posix_local', 'posix_prefix'] + if HAS_USER_BASE: + wanted.extend(['nt_user', 'osx_framework_user', 'posix_user']) + self.assertEqual(get_scheme_names(), tuple(sorted(wanted))) diff -Nru python3.10-3.10.2/debian/patches/series python3.10-3.10.2/debian/patches/series --- python3.10-3.10.2/debian/patches/series 2022-01-16 16:03:20.000000000 +0000 +++ python3.10-3.10.2/debian/patches/series 2022-02-14 11:04:06.000000000 +0000 @@ -37,3 +37,4 @@ sphinx3.diff destshared-location.diff fix-py_compile.diff +NEW-sysconfig-debian-schemes.diff