Make patches relative to where tarballs are extracted

Ever since an old patch version, it has (for reasonable security
reasons) not supported patched with ../ in the filename.
Many of our patches have been relying on this behaviour being OK,
because we start off with an ancient patch version that didn't perform
such checks. As soon as we need this behaviour after we build a newer
patch though, we will have problems.

So, let's change the policy.
Patches are relative to where tarballs are extracted, rather than the
"working directory" - e.g. have patches for `coreutils-9.4/src/cp.c`
instead of `src/cp.c`.
Keeping this consistent has a few implications;
- patches are applied from the build/ directory in bash era now, with
  `-p0`
- when patches are manually applied in the bash era, use `-p` as
  required, usually `-p1`
- in kaem era where patches are always manually applied, `-p1` is used
This commit is contained in:
fosslinux 2024-12-21 16:50:23 +11:00
parent 749b2bfe37
commit a67db8fcbd
156 changed files with 1265 additions and 1263 deletions

View file

@ -8,8 +8,8 @@ identical reasoning.
Python 2.3's unicode regeneration code is a bit too incompatible
with Python 2.0.1.
--- Objects/unicodectype.c 2022-10-05 18:11:21.989603599 +1100
+++ Objects/unicodectype.c 2022-10-05 18:14:57.335843857 +1100
--- Python-2.3.7/Objects/unicodectype.c 2022-10-05 18:11:21.989603599 +1100
+++ Python-2.3.7/Objects/unicodectype.c 2022-10-05 18:14:57.335843857 +1100
@@ -29,31 +29,12 @@
const unsigned char digit;
} _PyUnicode_TypeRecord;
@ -96,8 +96,8 @@ with Python 2.0.1.
}
int _PyUnicode_IsDigit(Py_UNICODE ch)
--- Makefile.pre.in 2005-01-12 00:49:02.000000000 +1100
+++ Makefile.pre.in 2022-10-05 18:35:05.979846971 +1100
--- Python-2.3.7/Makefile.pre.in 2005-01-12 00:49:02.000000000 +1100
+++ Python-2.3.7/Makefile.pre.in 2022-10-05 18:35:05.979846971 +1100
@@ -456,8 +456,7 @@
Python/importdl.o: $(srcdir)/Python/importdl.c
$(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c

View file

@ -18,7 +18,7 @@ src_prepare() {
grep generated -r . -l | grep encodings | xargs rm
# Disable unicode
patch -Np0 -i disable-unicode.patch
patch -Np1 -i disable-unicode.patch
# Regenerate sre_constants.h
rm Modules/sre_constants.h

View file

@ -5,8 +5,8 @@ SPDX-License-Identifier: PSF-2.0
musl (correctly) implements the POSIX posix_close function, however
this was added after Python 2.3.7 was released.
--- Modules/posixmodule.c 2022-10-05 18:38:46.718131893 +1100
+++ Modules/posixmodule.c 2022-10-05 18:39:07.049250312 +1100
--- Python-2.3.7/Modules/posixmodule.c 2022-10-05 18:38:46.718131893 +1100
+++ Python-2.3.7/Modules/posixmodule.c 2022-10-05 18:39:07.049250312 +1100
@@ -5208,12 +5208,12 @@
}

View file

@ -3,8 +3,8 @@ SPDX-FileCopyrightText: 2024 fosslinux <fosslinux@aussies.space>
SPDX-License-Identifier: PSF-2.0
Disable creation of pyc files.
--- Lib/py_compile.py 2024-01-22 11:28:44.333395804 +1100
+++ Lib/py_compile.py 2024-01-22 11:28:53.703636809 +1100
--- Python-2.3.7/Lib/py_compile.py 2024-01-22 11:28:44.333395804 +1100
+++ Python-2.3.7/Lib/py_compile.py 2024-01-22 11:28:53.703636809 +1100
@@ -112,6 +112,7 @@
directories).
@ -13,8 +13,8 @@ Disable creation of pyc files.
f = open(file, 'U')
try:
timestamp = long(os.fstat(f.fileno()).st_mtime)
--- Python/import.c 2024-01-22 12:24:05.300236204 +1100
+++ Python/import.c 2024-01-22 12:24:36.513082356 +1100
--- Python-2.3.7/Python/import.c 2024-01-22 12:24:05.300236204 +1100
+++ Python-2.3.7/Python/import.c 2024-01-22 12:24:36.513082356 +1100
@@ -807,6 +807,7 @@
static void
write_compiled_module(PyCodeObject *co, char *cpathname, long mtime)