diff --git a/brp-python-bytecompile-compatibility-with-newer-pyth.patch b/brp-python-bytecompile-compatibility-with-newer-pyth.patch new file mode 100644 index 0000000000000000000000000000000000000000..ebe7230148c2a5f0fe9c7974cd57250560a803b8 --- /dev/null +++ b/brp-python-bytecompile-compatibility-with-newer-pyth.patch @@ -0,0 +1,46 @@ +From acbf558c486ee3518aca74045504f05872da4a58 Mon Sep 17 00:00:00 2001 +From: Lumir Balhar +Date: Tue, 26 Sep 2023 13:14:44 +0200 +Subject: [PATCH] brp-python-bytecompile compatibility with newer pythons + +--- + scripts/brp-python-bytecompile | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/scripts/brp-python-bytecompile b/scripts/brp-python-bytecompile +index 4a9b49e..472bf10 100644 +--- a/scripts/brp-python-bytecompile ++++ b/scripts/brp-python-bytecompile +@@ -58,7 +58,7 @@ EOF + # and below /usr/lib/python3.1/, we're targeting /usr/bin/python3.1 + + shopt -s nullglob +-for python_libdir in `find "$RPM_BUILD_ROOT" -type d|grep -E "/usr/lib(64)?/python[0-9]\.[0-9]$"`; ++for python_libdir in `find "$RPM_BUILD_ROOT" -type d|grep -E "/usr/lib(64)?/python[0-9]\.[0-9]+$"`; + do + python_binary=/usr/bin/$(basename $python_libdir) + if [ "$python_binary" = "/usr/bin/python3.6" ]; then +@@ -97,17 +97,17 @@ fi + + # Figure out if there are files to be bytecompiled with the default_python at all + # this prevents unnecessary default_python invocation +-find "$RPM_BUILD_ROOT" -type f -name "*.py" | grep -Ev "/bin/|/sbin/|/usr/lib(64)?/python[0-9]\.[0-9]|/usr/share/doc" || exit 0 ++find "$RPM_BUILD_ROOT" -type f -name "*.py" | grep -Ev "/bin/|/sbin/|/usr/lib(64)?/python[0-9]\.[0-9]+|/usr/share/doc" || exit 0 + + # Generate normal (.pyc) byte-compiled files. +-python_bytecompile "" $default_python "/bin/|/sbin/|/usr/lib(64)?/python[0-9]\.[0-9]|/usr/share/doc" "$RPM_BUILD_ROOT" "$depth" "/" ++python_bytecompile "" $default_python "/bin/|/sbin/|/usr/lib(64)?/python[0-9]\.[0-9]+|/usr/share/doc" "$RPM_BUILD_ROOT" "$depth" "/" + if [ $? -ne 0 -a 0$errors_terminate -ne 0 ]; then + # One or more of the files had a syntax error + exit 1 + fi + + # Generate optimized (.pyo) byte-compiled files. +-python_bytecompile "-O" $default_python "/bin/|/sbin/|/usr/lib(64)?/python[0-9]\.[0-9]|/usr/share/doc" "$RPM_BUILD_ROOT" "$depth" "/" ++python_bytecompile "-O" $default_python "/bin/|/sbin/|/usr/lib(64)?/python[0-9]\.[0-9]+|/usr/share/doc" "$RPM_BUILD_ROOT" "$depth" "/" + if [ $? -ne 0 -a 0$errors_terminate -ne 0 ]; then + # One or more of the files had a syntax error + exit 1 +-- +2.41.0 + diff --git a/rpm.spec b/rpm.spec index d17e0d08a837d402fbadc8b16d3e23925e4abf56..5366433012c1e94e7f63094258e7578fb1985d4d 100644 --- a/rpm.spec +++ b/rpm.spec @@ -1,5 +1,4 @@ -%define anolis_release .0.9 - +%define anolis_release .0.1 %define _legacy_common_support 1 # build against xz? %bcond_without xz @@ -38,7 +37,7 @@ %global rpmver 4.14.3 #global snapver rc2 -%global rel 27 +%global rel 31 %global srcver %{version}%{?snapver:-%{snapver}} %global srcdir %{?snapver:testing}%{!?snapver:%{name}-%(echo %{version} | cut -d'.' -f1-2).x} @@ -125,28 +124,17 @@ Patch165: rpm-4.16.1.3-rpm2archive-error-handling.patch Patch166: rpm-4.14.3-rpm2archive-nocompression.patch Patch167: rpm-4.14.3-rpm2archive-parse-popt-options.patch Patch168: rpm-4.14.3-rpm2archive-Don-t-print-usage.patch -#https://github.com/rpm-software-management/rpm/commit/ddf56e678676abb436906ada650680c8c13c4a3c +# Backport fsm to fix CVEs Patch169: 0001-Eliminate-code-duplication-from-rpmfiNext.patch -#https://github.com/rpm-software-management/rpm/commit/fb13f7fd9eff012cb7b9dbf94ac5381c69404055 Patch170: 0001-Add-optional-callback-on-directory-changes-during-rp.patch -#https://github.com/rpm-software-management/rpm/commit/35195684d29f495bfd982516044e05deed832b6e Patch171: 0001-Pass-file-descriptor-to-file-prepare-plugin-hook-use.patch -#https://github.com/rpm-software-management/rpm/commit/6dd62720fe84f7e2ad902c915b952fc0b29e3dcd Patch172: 0001-Swap-over-to-dirfd-basename-based-operation-within-t.patch -#https://github.com/rpm-software-management/rpm/commit/2668a2cabfe097d58adb9810da1cc8aa7fe1cc91 -#https://github.com/rpm-software-management/rpm/commit/930650a9377ce72b51d56c94f0d077608d6b839e -#https://github.com/rpm-software-management/rpm/commit/1c98b67911e19a5f92c7fa4492aaa1000a06edad Patch173: 0001-Use-file-state-machine-from-rpm-4.19.patch -#https://github.com/rpm-software-management/rpm/commit/c140768202e271b60910644c1e4bf848a50218d3 Patch174: 0001-Emit-full-paths-for-file-disposition-diagnostics-on-.patch -#https://github.com/rpm-software-management/rpm/commit/89ce4e7ca592f5abafc3f25aeaa07d36a7b43a61 Patch175: 0001-Fix-wrong-return-code-on-O_DIRECTORY-open-of-invalid.patch -#https://github.com/rpm-software-management/rpm/commit/dcf8c5abc64eb0fe3c81482008b8a13bec19eb20 Patch176: 0001-Print-full-path-if-file-removal-fails.patch -#https://github.com/rpm-software-management/rpm/commit/6c66abd34cccbb5b3c063f8f613e0c2faffc415f Patch177: 0001-Don-t-warn-about-missing-user-group-on-skipped-files.patch - # Python 3 string API sanity Patch500: 0001-In-Python-3-return-all-our-string-data-as-surrogate-.patch Patch501: 0001-Return-NULL-string-as-None-from-utf8FromString.patch @@ -177,6 +165,8 @@ Patch1000: disable-python-extra.patch Patch1001: compile-with-Platform-Python-binary-where-relevant.patch # make unversioned %%__python an error unless explicitly overridden Patch1002: rpm-4.14.2-unversioned-python.patch +# Make brp-python-bytecompile compatible with Python 3.10+ +Patch1003: brp-python-bytecompile-compatibility-with-newer-pyth.patch Patch2000: 1000-rpm-anolis-support-loongarch.patch Patch2001: 0001-debugedit-add-loongarch-support.patch @@ -760,44 +750,33 @@ rpm -q rpm 2>&1 | grep bdb && rpmdb --rebuilddb %doc doc/librpm/html/* %changelog -* Mon May 27 2024 Weisson - 4.14.4-27.0.9 -- Fix compatibility of debugedit tool on sw_64 platform. - -* Mon Apr 8 2024 Weisson - 4.14.4-27.0.8 -- keep compatibility between sw and other architecture. - -* Wed Mar 20 2024 Weisson - 4.14.4-27.0.7 -- update config to support sw64 Architecture. - -* Wed Mar 20 2024 hpp - 4.14.4-27.0.6 -- Add sw64 Architecture - -* Thu Feb 29 2024 Kaiqiang Wang - 4.14.4-27.0.5 -- Backport file handling code from rpm-4.19 to fix CVE-2021-35937, - CVE-2021-35938 and CVE-2021-35939 - -* Wed Jan 24 2024 Kaiqiang Wang - 4.14.4-26.0.5 -- Fix a copy-paste --help description of --whatconflicts -- https://bugzilla.openanolis.cn/show_bug.cgi?id=8035 - -* Thu Sep 07 2023 Chunmei Xu - 4.14.4-26.0.4 -- avoid dead loop in db3_dbiOpen when db_create failed -- do not switch rpmdb to sqlite - -* Tue Jul 25 2023 Liwei Ge - 4.14.4-26.0.3 -- conditional set relbuf for loongarch debugedit - -* Thu Jun 29 2023 forrest_ly - 4.14.4-26.0.2 -- Support and switch rpmdb to sqlite - -* Wed Jun 14 2023 Liwei Ge - 4.14.4-26.0.1 +* Thu Jul 18 2024 Liwei Ge - 4.14.4-31.0.1 - Rebrand for Anolis OS - Fix gcc10 -fno-common compile issue for compatible with gcc10 build - Support loongarch for rpm - Add loongarch64 support for debugedit(doupengda@loongson.cn) - Modify the spec to add debugedit for loongarch64(zhangwenlong@loongson.cn) +- Support and switch rpmdb to sqlite (flin@linux.alibaba.com) +- conditional set relbuf for loongarch debugedit (geliwei@openanolis.org) +- avoid dead loop in db3_dbiOpen when db_create failed (xuchunmei@linux.alibaba.com) +- do not switch rpmdb to sqlite (xuchunmei@linux.alibaba.com) +- Fix a copy-paste --help description of --whatconflicts (wangkaiqiang@inspur.com) +- https://bugzilla.openanolis.cn/show_bug.cgi?id=8035 (wangkaiqiang@inspur.com) +- Add sw64 Architecture (nijie@wxiat.com) +- update config to support sw64 Architecture. (Weisson@linux.alibaba.com) +- keep compatibility between sw and other architecture. (Weisson@linux.alibaba.com) +- Fix compatibility of debugedit tool on sw_64 platform. (Weisson@linux.alibaba.com) + + +* Tue Dec 12 2023 Florian Festi - 4.14.3-31 +- Backport file handling code from rpm-4.19 to fix CVE-2021-35937, + CVE-2021-35938 and CVE-2021-35939 + +* Tue Sep 26 2023 Lumír Balhar - 4.14.3-27 +- Make brp-python-bytecompile script compatible with Python 3.10+ +Resolves: RHEL-6423 -* Mon Dec 19 2022 Florian Festi - 4.14.4-26 +* Mon Dec 19 2022 Florian Festi - 4.14.3-26 - Add --nocompression to rpm2archive (#2129345) * Tue Sep 13 2022 Michal Domonkos - 4.14.3-24