Spec: Set the python version explicitly to 3.9

The __python3 macro defaults to /usr/bin/python3. This is not a problem
as long as the python3 symlink always points to the python3.9 runtime.
If that is changed via alternatives or another means, the following
error is returned:

  Traceback (most recent call last):
    File "/usr/bin/dnf", line 61, in <module>
      from dnf.cli import main
  ModuleNotFoundError: No module named 'dnf'

This update specifically sets the __python3 macro to /usr/bin/python3.9
which results in the following shebang within /usr/bin/dnf:

  #!/usr/bin/python3.9

Resolves: rhbz#2211019

Signed-off-by: Kyle Walker <kwalker@redhat.com>
This commit is contained in:
Kyle Walker 2023-05-30 14:16:34 -04:00
parent 2e74dd7138
commit 219f083e34

View File

@ -56,6 +56,9 @@
%global py3pluginpath %{python3_sitelib}/%{name}-plugins %global py3pluginpath %{python3_sitelib}/%{name}-plugins
# To avoid breakage if the python3 symlink is changed
%{?python3_version:%global __python3 /usr/bin/python%{python3_version}}
# Use the same directory of the main package for subpackage licence and docs # Use the same directory of the main package for subpackage licence and docs
%global _docdir_fmt %{name} %global _docdir_fmt %{name}
@ -66,7 +69,7 @@ It supports RPMs, modules and comps groups & environments.
Name: dnf Name: dnf
Version: 4.14.0 Version: 4.14.0
Release: 6%{?dist} Release: 7%{?dist}
Summary: %{pkg_summary} Summary: %{pkg_summary}
# For a breakdown of the licensing, see PACKAGE-LICENSING # For a breakdown of the licensing, see PACKAGE-LICENSING
License: GPLv2+ License: GPLv2+
@ -369,6 +372,9 @@ popd
%{python3_sitelib}/%{name}/automatic/ %{python3_sitelib}/%{name}/automatic/
%changelog %changelog
* Tue May 30 2023 Kyle Walker <kwalker@redhat.com> - 4.14.0-7
- Explicitly use the python3.9 runtime (RhBug:2211019)
* Thu May 11 2023 Jaroslav Rohel <jrohel@redhat.com> - 4.14.0-6 * Thu May 11 2023 Jaroslav Rohel <jrohel@redhat.com> - 4.14.0-6
- Add reboot option to DNF Automatic (RhBug:2124793) - Add reboot option to DNF Automatic (RhBug:2124793)
- Omit src RPMs from check-update (RhBug:2151910,2203069) - Omit src RPMs from check-update (RhBug:2151910,2203069)