diff --git a/SPECS/python39.spec b/SPECS/python39.spec index d482147..c5b2164 100644 --- a/SPECS/python39.spec +++ b/SPECS/python39.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 1%{?dist} +Release: 2%{?dist} License: Python # Exclude i686 arch. Due to a modularity issue it's being added to the @@ -408,10 +408,10 @@ Patch353: 00353-architecture-names-upstream-downstream.patch # Descriptions, and metadata for subpackages # ========================================== -# Runtime require alternatives -Requires: %{_sbindir}/alternatives -Requires(post): %{_sbindir}/alternatives -Requires(postun): %{_sbindir}/alternatives +# Require alternatives version that implements the --keep-foreign flag +Requires: alternatives >= 1.19.1-1 +Requires(post): alternatives >= 1.19.1-1 +Requires(postun): alternatives >= 1.19.1-1 # When the user tries to `yum install python`, yum will list this package among # the possible alternatives @@ -584,6 +584,8 @@ Requires: %{pkgname}-libs%{?_isa} = %{version}-%{release} Requires: (python-rpm-macros if rpm-build) Requires: (python3-rpm-macros if rpm-build) +# Require alternatives version that implements the --keep-foreign flag +Requires(postun): alternatives >= 1.19.1-1 # python39 installs the alternatives master symlink to which we attach a slave Requires(post): %{pkgname} Requires(postun): %{pkgname} @@ -632,6 +634,8 @@ Provides: %{pkgname}-tools = %{version}-%{release} Provides: %{pkgname}-tools%{?_isa} = %{version}-%{release} Obsoletes: %{pkgname}-tools < %{version}-%{release} +# Require alternatives version that implements the --keep-foreign flag +Requires(postun): alternatives >= 1.19.1-1 # python39 installs the alternatives master symlink to which we attach a slave Requires(post): %{pkgname} Requires(postun): %{pkgname} @@ -691,6 +695,8 @@ Provides: platform-python-debug%{?_isa} = %{version}-%{release} Obsoletes: platform-python-debug < %{pybasever} %endif +# Require alternatives version that implements the --keep-foreign flag +Requires(postun): alternatives >= 1.19.1-1 # python39 installs the alternatives master symlink to which we attach a slave Requires(post): %{pkgname} Requires(postun): %{pkgname} @@ -1369,15 +1375,15 @@ fi %postun # Do this only during uninstall process (not during update) if [ $1 -eq 0 ]; then - alternatives --remove python \ + alternatives --keep-foreign --remove python \ %{_bindir}/python3.9 - alternatives --remove python3 \ + alternatives --keep-foreign --remove python3 \ %{_bindir}/python3.9 # Remove link python → python3 if no other python3.* exists if ! alternatives --display python3 > /dev/null; then - alternatives --remove python \ + alternatives --keep-foreign --remove python \ %{_bindir}/python3 fi fi @@ -1392,7 +1398,7 @@ alternatives --add-slave python3 %{_bindir}/python3.9 \ %postun devel # Do this only during uninstall process (not during update) if [ $1 -eq 0 ]; then - alternatives --remove-slave python3 %{_bindir}/python3.9 \ + alternatives --keep-foreign --remove-slave python3 %{_bindir}/python3.9 \ python3-config fi @@ -1410,9 +1416,9 @@ alternatives --add-slave python3 %{_bindir}/python3.9 \ %postun debug # Do this only during uninstall process (not during update) if [ $1 -eq 0 ]; then - alternatives --remove-slave python3 %{_bindir}/python3.9 \ + alternatives --keep-foreign --remove-slave python3 %{_bindir}/python3.9 \ python3-debug - alternatives --remove-slave python3 %{_bindir}/python3.9 \ + alternatives --keep-foreign --remove-slave python3 %{_bindir}/python3.9 \ python3-debug-config fi @@ -1426,7 +1432,7 @@ alternatives --add-slave python3 %{_bindir}/python3.9 \ %postun idle # Do this only during uninstall process (not during update) if [ $1 -eq 0 ]; then - alternatives --remove-slave python3 %{_bindir}/python3.9 \ + alternatives --keep-foreign --remove-slave python3 %{_bindir}/python3.9 \ idle3 fi @@ -1959,6 +1965,10 @@ fi # ====================================================== %changelog +* Thu Aug 05 2021 Tomas Orsava - 3.9.6-2 +- Adjusted the postun scriptlets to enable upgrading to RHEL 9 +- Resolves: rhbz#1933055 + * Tue Jul 27 2021 Charalampos Stratakis - 3.9.6-1 - Update to 3.9.6 - Fix CVE-2021-29921: Improper input validation of octal strings in the ipaddress module