kumquat-buildroot/package/python3/0015-fix-building-on-older-distributions.patch
Adam Duskett 36e635d2d5 package/python3: bump version to 3.12.1
Python 3.12.1 has removed distutils support. As such, we remove the distutils
option from pkg-python.mk as well.

Tested on Fedora 39, and Debian 11. All 68 package tests pass.

Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-02-06 23:21:22 +01:00

50 lines
1.7 KiB
Diff

From 56d4b5976a5ba57ccbb2e00c7bdfaa3a57384224 Mon Sep 17 00:00:00 2001
From: Adam Duskett <aduskett@gmail.com>
Date: Thu, 16 Aug 2018 14:52:37 -0700
Subject: [PATCH] fix building on older distributions
Python > 3.6.3 calls os.replace in the update_file.py script, during the
regen-importlib phase of the build process.
According to Doc/whatsnew/3.3.rst line 1631, os.replace acts in the same
way as os.rename, however, it is now cross-platform compatible for Windows.
Because BuildRoot is guaranteed only to be built in POSIX environment, it is
safe to change os.replace back to os.rename.
This change fixes building on older systems such as CentOS7, that only come
with python 2.
Signed-off-by: Adam Duskett <aduskett@gmail.com>
[ Adam Duskett: ported to Python 3.12.1 ]
Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
---
Tools/build/update_file.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Tools/build/update_file.py b/Tools/build/update_file.py
index b4182c1d0cb..ab443cb1a60 100644
--- a/Tools/build/update_file.py
+++ b/Tools/build/update_file.py
@@ -53,7 +53,7 @@ def update_file_with_tmpfile(filename, tmpfile, *, create=False):
if not create:
raise # re-raise
outcome = 'created'
- os.replace(tmpfile, filename)
+ os.rename(tmpfile, filename)
else:
with targetfile:
old_contents = targetfile.read()
@@ -62,7 +62,7 @@ def update_file_with_tmpfile(filename, tmpfile, *, create=False):
# Now compare!
if old_contents != new_contents:
outcome = 'updated'
- os.replace(tmpfile, filename)
+ os.rename(tmpfile, filename)
else:
outcome = 'same'
os.unlink(tmpfile)
--
2.43.0