Change Python -> python

(lowercase convention)
This commit is contained in:
fosslinux 2023-01-18 22:57:04 +11:00
parent a4d1a445ac
commit 6ec368ce37
46 changed files with 30 additions and 30 deletions

View file

@ -0,0 +1,110 @@
SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
SPDX-License-Identifier: PSF-2.0
This is a nearly-equivalent patch to Python 2.0.1, with nearly
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
@@ -29,31 +29,12 @@
const unsigned char digit;
} _PyUnicode_TypeRecord;
-#include "unicodetype_db.h"
-
-static const _PyUnicode_TypeRecord *
-gettyperecord(Py_UNICODE code)
-{
- int index;
-
- if (code >= 0x110000)
- index = 0;
- else {
- index = index1[(code>>SHIFT)];
- index = index2[(index<<SHIFT)+(code&((1<<SHIFT)-1))];
- }
-
- return &_PyUnicode_TypeRecords[index];
-}
-
/* Returns 1 for Unicode characters having the category 'Zl' or type
'B', 0 otherwise. */
int _PyUnicode_IsLinebreak(Py_UNICODE ch)
{
- const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
-
- return (ctype->flags & LINEBREAK_MASK) != 0;
+ return 0;
}
/* Returns the titlecase Unicode characters corresponding to ch or just
@@ -61,18 +42,7 @@
Py_UNICODE _PyUnicode_ToTitlecase(register Py_UNICODE ch)
{
- const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
- int delta;
-
- if (ctype->title)
- delta = ctype->title;
- else
- delta = ctype->upper;
-
- if (delta >= 32768)
- delta -= 65536;
-
- return ch + delta;
+ return ch;
}
/* Returns 1 for Unicode characters having the category 'Lt', 0
@@ -80,9 +50,7 @@
int _PyUnicode_IsTitlecase(Py_UNICODE ch)
{
- const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
-
- return (ctype->flags & TITLE_MASK) != 0;
+ return 0;
}
/* Returns the integer decimal (0-9) for Unicode characters having
@@ -90,9 +58,7 @@
int _PyUnicode_ToDecimalDigit(Py_UNICODE ch)
{
- const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
-
- return (ctype->flags & DECIMAL_MASK) ? ctype->decimal : -1;
+ return -1;
}
int _PyUnicode_IsDecimalDigit(Py_UNICODE ch)
@@ -107,9 +73,7 @@
int _PyUnicode_ToDigit(Py_UNICODE ch)
{
- const _PyUnicode_TypeRecord *ctype = gettyperecord(ch);
-
- return (ctype->flags & DIGIT_MASK) ? ctype->digit : -1;
+ return -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
@@ -456,8 +456,7 @@
Python/importdl.o: $(srcdir)/Python/importdl.c
$(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
-Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \
- $(srcdir)/Objects/unicodetype_db.h
+Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c
############################################################################
# Header files

View file

@ -0,0 +1,33 @@
SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
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
@@ -5208,12 +5208,12 @@
}
-PyDoc_STRVAR(posix_close__doc__,
+PyDoc_STRVAR(py_posix_close__doc__,
"close(fd)\n\n\
Close a file descriptor (for low level IO).");
static PyObject *
-posix_close(PyObject *self, PyObject *args)
+py_posix_close(PyObject *self, PyObject *args)
{
int fd, res;
if (!PyArg_ParseTuple(args, "i:close", &fd))
@@ -7371,7 +7371,7 @@
{"tcsetpgrp", posix_tcsetpgrp, METH_VARARGS, posix_tcsetpgrp__doc__},
#endif /* HAVE_TCSETPGRP */
{"open", posix_open, METH_VARARGS, posix_open__doc__},
- {"close", posix_close, METH_VARARGS, posix_close__doc__},
+ {"close", py_posix_close, METH_VARARGS, py_posix_close__doc__},
{"dup", posix_dup, METH_VARARGS, posix_dup__doc__},
{"dup2", posix_dup2, METH_VARARGS, posix_dup2__doc__},
{"lseek", posix_lseek, METH_VARARGS, posix_lseek__doc__},

View file

@ -0,0 +1,3 @@
https://www.python.org/ftp/python/2.3.7/Python-2.3.7.tgz 969a9891dce9f50b13e54f9890acaf2be66715a5895bf9b11111f320c205b90e
http://ftp.unicode.org/Public/3.2-Update/UnicodeData-3.2.0.txt 5e444028b6e76d96f9dc509609c5e3222bf609056f35e5fcde7e6fb8a58cd446
http://ftp.unicode.org/Public/3.2-Update/CompositionExclusions-3.2.0.txt 1d3a450d0f39902710df4972ac4a60ec31fbcb54ffd4d53cd812fc1200c732cb

70
sysc/python-2.3.7/stage1.sh Executable file
View file

@ -0,0 +1,70 @@
# SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
default
# Remove broken file
rm Lib/test/test_pep263.py
# Delete generated files
rm Modules/glmodule.c
rm Modules/unicodedata_db.h Objects/unicodetype_db.h
rm Lib/stringprep.py
mv Lib/plat-generic .
rm -r Lib/plat-*
mv plat-generic Lib/
grep generated -r . -l | grep encodings | xargs rm
# Disable unicode
patch -Np0 -i disable-unicode.patch
# Regenerate sre_constants.h
rm Modules/sre_constants.h
python Lib/sre_constants.py
# Regen ast module
rm Lib/compiler/ast.py
pushd Tools/compiler
python astgen.py > ../../Lib/compiler/ast.py
popd
# Regenerate autoconf
autoreconf-2.71 -fi
}
src_configure() {
MACHDEP=linux ac_sys_system=Linux \
CFLAGS="-U__DATE__ -U__TIME__" \
./configure \
--prefix="${PREFIX}" \
--libdir="${PREFIX}/lib/musl" \
--with-wctype-functions
}
src_compile() {
# Build pgen
make Parser/pgen
# Regen graminit.c and graminit.h
make Include/graminit.h
# Regenerate some Python scripts using the other regenerated files
# Must move them out to avoid using Lib/ module files which are
# incompatible with running version of Python
cp Lib/{symbol,keyword,token}.py .
python symbol.py
python keyword.py
python token.py
# Now build the main program
make CFLAGS="-U__DATE__ -U__TIME__"
}
src_install() {
default
# Remove non-reproducible .pyc/o files
find "${DESTDIR}" -name "*.pyc" -delete
find "${DESTDIR}" -name "*.pyo" -delete
}

71
sysc/python-2.3.7/stage2.sh Executable file
View file

@ -0,0 +1,71 @@
# SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
default
# Remove broken file
rm Lib/test/test_pep263.py
# Delete generated files
rm Modules/glmodule.c
rm Lib/stringprep.py
mv Lib/plat-generic .
rm -r Lib/plat-*
mv plat-generic Lib/
grep generated -r . -l | grep encodings | xargs rm
# Regenerate unicode
rm Modules/unicodedata_db.h Modules/unicodename_db.h Objects/unicodetype_db.h
mv ../UnicodeData-3.2.0.txt UnicodeData.txt
mv ../CompositionExclusions-3.2.0.txt CompositionExclusions.txt
python Tools/unicode/makeunicodedata.py
# Regenerate sre_constants.h
rm Modules/sre_constants.h
python Lib/sre_constants.py
# Regen ast module
rm Lib/compiler/ast.py
pushd Tools/compiler
python astgen.py > ../../Lib/compiler/ast.py
popd
# Regenerate autoconf
autoreconf-2.71 -fi
}
src_configure() {
MACHDEP=linux ac_sys_system=Linux \
CFLAGS="-U__DATE__ -U__TIME__" \
./configure \
--prefix="${PREFIX}" \
--libdir="${PREFIX}/lib/musl"
}
src_compile() {
# Build pgen
make Parser/pgen
# Regen graminit.c and graminit.h
make Include/graminit.h
# Regenerate some Python scripts using the other regenerated files
# Must move them out to avoid using Lib/ module files which are
# incompatible with running version of Python
cp Lib/{symbol,keyword,token}.py .
python symbol.py
python keyword.py
python token.py
# Now build the main program
make CFLAGS="-U__DATE__ -U__TIME__"
}
src_install() {
default
# Remove non-reproducible .pyc/o files
find "${DESTDIR}" -name "*.pyc" -delete
find "${DESTDIR}" -name "*.pyo" -delete
}