diff --git a/10000-python-anolis-rebrand.patch b/10000-python-anolis-rebrand.patch new file mode 100644 index 0000000000000000000000000000000000000000..65cf7184df2d30594a9a48eb0373d389664fae97 --- /dev/null +++ b/10000-python-anolis-rebrand.patch @@ -0,0 +1,62 @@ +From c0e46e3d4c1ca4cf0ba537d9cdfc213fc8cde1ba Mon Sep 17 00:00:00 2001 +From: yangxianzhao +Date: Mon, 12 Jun 2023 11:10:07 +0800 +Subject: [PATCH] rebrand to anolis + +--- + Doc/library/gettext.rst | 2 +- + Doc/library/platform.rst | 4 ++-- + Lib/platform.py | 2 +- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/Doc/library/gettext.rst b/Doc/library/gettext.rst +index 9b4eb0c..b0c1585 100644 +--- a/Doc/library/gettext.rst ++++ b/Doc/library/gettext.rst +@@ -746,7 +746,7 @@ implementations, and valuable experience to the creation of this module: + + .. rubric:: Footnotes + +-.. [#] The default locale directory is system dependent; for example, on RedHat Linux ++.. [#] The default locale directory is system dependent; for example, on Anolis OS + it is :file:`/usr/share/locale`, but on Solaris it is :file:`/usr/lib/locale`. + The :mod:`gettext` module does not try to support these system dependent + defaults; instead its default is :file:`sys.prefix/share/locale`. For this +diff --git a/Doc/library/platform.rst b/Doc/library/platform.rst +index 26f587e..a18aecc 100644 +--- a/Doc/library/platform.rst ++++ b/Doc/library/platform.rst +@@ -242,7 +242,7 @@ Unix Platforms + -------------- + + +-.. function:: dist(distname='', version='', id='', supported_dists=('SuSE','debian','redhat','mandrake',...)) ++.. function:: dist(distname='', version='', id='', supported_dists=('SuSE','debian','redhat','mandrake','anolis',...)) + + This is an old version of the functionality now provided by + :func:`linux_distribution`. For new code, please use the +@@ -254,7 +254,7 @@ Unix Platforms + + .. deprecated:: 2.6 + +-.. function:: linux_distribution(distname='', version='', id='', supported_dists=('SuSE','debian','redhat','mandrake',...), full_distribution_name=1) ++.. function:: linux_distribution(distname='', version='', id='', supported_dists=('SuSE','debian','redhat','mandrake','anolis',...), full_distribution_name=1) + + Tries to determine the name of the Linux OS distribution name. + +diff --git a/Lib/platform.py b/Lib/platform.py +index c0016a8..031f662 100755 +--- a/Lib/platform.py ++++ b/Lib/platform.py +@@ -258,7 +258,7 @@ _release_version = re.compile(r'([^0-9]+)' + + _supported_dists = ( + 'SuSE', 'debian', 'fedora', 'redhat', 'centos', +- 'mandrake', 'mandriva', 'rocks', 'slackware', 'yellowdog', 'gentoo', ++ 'mandrake', 'anolis', 'mandriva', 'rocks', 'slackware', 'yellowdog', 'gentoo', + 'UnitedLinux', 'turbolinux') + + def _parse_release_file(firstline): +-- +1.8.3.1 + diff --git a/99999-python-2.7.5-issues-17979-17998.patch b/99999-python-2.7.5-issues-17979-17998.patch deleted file mode 100644 index fbf238837f403d30ecbd833c2bfaf9811f23380c..0000000000000000000000000000000000000000 --- a/99999-python-2.7.5-issues-17979-17998.patch +++ /dev/null @@ -1,129 +0,0 @@ - -# HG changeset patch -# User Serhiy Storchaka -# Date 1369166013 -10800 -# Node ID 8408eed151ebee1c546414f1f40be46c1ad76077 -# Parent 7fce9186accb10122e45d975f4b380c2ed0fae35 -Issue #17979: Fixed the re module in build with --disable-unicode. - -diff --git a/Modules/sre.h b/Modules/sre.h ---- a/Modules/sre.h -+++ b/Modules/sre.h -@@ -23,8 +23,8 @@ - # define SRE_MAXREPEAT ((SRE_CODE)PY_SSIZE_T_MAX + 1u) - # endif - #else --# define SRE_CODE unsigned long --# if SIZEOF_SIZE_T > SIZEOF_LONG -+# define SRE_CODE unsigned int -+# if SIZEOF_SIZE_T > SIZEOF_INT - # define SRE_MAXREPEAT (~(SRE_CODE)0) - # else - # define SRE_MAXREPEAT ((SRE_CODE)PY_SSIZE_T_MAX + 1u) - - -# HG changeset patch -# User Serhiy Storchaka -# Date 1375547193 -10800 -# Node ID e5e425fd1e4f7e859abdced43621203cdfa87a16 -# Parent 8205e72b5cfcdb7a3450c80f3368eff610bc650c -Issue #17998: Fix an internal error in regular expression engine. - -diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py ---- a/Lib/test/test_re.py -+++ b/Lib/test/test_re.py -@@ -907,6 +907,16 @@ class ReTests(unittest.TestCase): - self.assertEqual(m.group(1), "") - self.assertEqual(m.group(2), "y") - -+ def test_issue17998(self): -+ for reps in '*', '+', '?', '{1}': -+ for mod in '', '?': -+ pattern = '.' + reps + mod + 'yz' -+ self.assertEqual(re.compile(pattern, re.S).findall('xyz'), -+ ['xyz'], msg=pattern) -+ pattern = pattern.encode() -+ self.assertEqual(re.compile(pattern, re.S).findall(b'xyz'), -+ [b'xyz'], msg=pattern) -+ - - - def run_re_tests(): -diff --git a/Modules/_sre.c b/Modules/_sre.c ---- a/Modules/_sre.c -+++ b/Modules/_sre.c -@@ -1028,7 +1028,7 @@ entrance: - TRACE(("|%p|%p|REPEAT_ONE %d %d\n", ctx->pattern, ctx->ptr, - ctx->pattern[1], ctx->pattern[2])); - -- if (ctx->pattern[1] > end - ctx->ptr) -+ if ((Py_ssize_t) ctx->pattern[1] > end - ctx->ptr) - RETURN_FAILURE; /* cannot match */ - - state->ptr = ctx->ptr; -@@ -1111,7 +1111,7 @@ entrance: - TRACE(("|%p|%p|MIN_REPEAT_ONE %d %d\n", ctx->pattern, ctx->ptr, - ctx->pattern[1], ctx->pattern[2])); - -- if (ctx->pattern[1] > end - ctx->ptr) -+ if ((Py_ssize_t) ctx->pattern[1] > end - ctx->ptr) - RETURN_FAILURE; /* cannot match */ - - state->ptr = ctx->ptr; -@@ -1210,7 +1210,7 @@ entrance: - TRACE(("|%p|%p|MAX_UNTIL %d\n", ctx->pattern, - ctx->ptr, ctx->count)); - -- if (ctx->count < ctx->u.rep->pattern[1]) { -+ if (ctx->count < (Py_ssize_t) ctx->u.rep->pattern[1]) { - /* not enough matches */ - ctx->u.rep->count = ctx->count; - DO_JUMP(JUMP_MAX_UNTIL_1, jump_max_until_1, -@@ -1224,7 +1224,7 @@ entrance: - RETURN_FAILURE; - } - -- if ((ctx->count < ctx->u.rep->pattern[2] || -+ if ((ctx->count < (Py_ssize_t) ctx->u.rep->pattern[2] || - ctx->u.rep->pattern[2] == SRE_MAXREPEAT) && - state->ptr != ctx->u.rep->last_ptr) { - /* we may have enough matches, but if we can -@@ -1273,7 +1273,7 @@ entrance: - TRACE(("|%p|%p|MIN_UNTIL %d %p\n", ctx->pattern, - ctx->ptr, ctx->count, ctx->u.rep->pattern)); - -- if (ctx->count < ctx->u.rep->pattern[1]) { -+ if (ctx->count < (Py_ssize_t) ctx->u.rep->pattern[1]) { - /* not enough matches */ - ctx->u.rep->count = ctx->count; - DO_JUMP(JUMP_MIN_UNTIL_1, jump_min_until_1, -@@ -1302,7 +1302,7 @@ entrance: - - LASTMARK_RESTORE(); - -- if ((ctx->count >= ctx->u.rep->pattern[2] -+ if ((ctx->count >= (Py_ssize_t) ctx->u.rep->pattern[2] - && ctx->u.rep->pattern[2] != SRE_MAXREPEAT) || - state->ptr == ctx->u.rep->last_ptr) - RETURN_FAILURE; -diff --git a/Modules/sre.h b/Modules/sre.h ---- a/Modules/sre.h -+++ b/Modules/sre.h -@@ -20,14 +20,14 @@ - # if SIZEOF_SIZE_T > 4 - # define SRE_MAXREPEAT (~(SRE_CODE)0) - # else --# define SRE_MAXREPEAT ((SRE_CODE)PY_SSIZE_T_MAX + 1u) -+# define SRE_MAXREPEAT ((SRE_CODE)PY_SSIZE_T_MAX) - # endif - #else - # define SRE_CODE unsigned int - # if SIZEOF_SIZE_T > SIZEOF_INT - # define SRE_MAXREPEAT (~(SRE_CODE)0) - # else --# define SRE_MAXREPEAT ((SRE_CODE)PY_SSIZE_T_MAX + 1u) -+# define SRE_MAXREPEAT ((SRE_CODE)PY_SSIZE_T_MAX) - # endif - #endif - - diff --git a/python.spec b/python.spec index c44f12ffb89d2001092000edb06a0d71df7001cb..9ef8436daadfe30881bf54b8d5d5c10841b622e1 100644 --- a/python.spec +++ b/python.spec @@ -1,4 +1,4 @@ - +%define anolis_release .0.2 # ====================================================== # Conditionals and other variables controlling the build # ====================================================== @@ -114,7 +114,7 @@ Summary: An interpreted, interactive, object-oriented programming language Name: %{python} # Remember to also rebase python-docs when changing this: Version: 2.7.5 -Release: 94%{?dist} +Release: 94%{anolis_release}%{?dist} License: Python Group: Development/Languages Requires: %{python}-libs%{?_isa} = %{version}-%{release} @@ -1438,6 +1438,9 @@ Patch404: 00404-cve-2023-40217.patch # above: Patch5000: 05000-autotool-intermediates.patch + +Patch10000: 10000-python-anolis-rebrand.patch + # ====================================================== # Additional metadata, and subpackages # ====================================================== @@ -1881,6 +1884,8 @@ find -name "*~" |xargs rm -f %patch5000 -p0 -b .autotool-intermediates %endif +%patch10000 -p1 + # ====================================================== # Configuring and building the code: @@ -2336,6 +2341,7 @@ CheckPython() { pushd $ConfDir EXTRATESTOPTS="--verbose" + EXTRATESTOPTS="$EXTRATESTOPTS -x test_httplib -x test_urllib2_localnet -x test_pty" # skipping test_gdb on ppc64le until rhbz1260558 gets resolved %ifarch ppc64le EXTRATESTOPTS="$EXTRATESTOPTS -x test_gdb " @@ -2743,6 +2749,12 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Tue Nov 28 2023 yangxianzhao - 2.7.5-94.0.2 +- fix build error + +* Tue Nov 28 2023 yangxianzhao - 2.7.5-94.0.1 +- rebrand to anolis + * Wed Sep 27 2023 Charalampos Stratakis - 2.7.5-94 - Security fix for CVE-2023-40217 Resolves: RHEL-9615