Skip to content

Commit

Permalink
config: properly configure package manager commands
Browse files Browse the repository at this point in the history
There was a missing `system_dnf5_command` option.

The `dnf_command` (DNF4) is changed from /bin/dnf to /bin/dnf-3.  The
`/bin/dnf-3` script exists since ever and clearly denotes DNF4 (there
used to be two suffixes, `-2` for Python 2 and `-3` for Python 3, but
the `-3` clearly means the DNF4 written in Python).  Doing the same for
`system_dnf_command`.

The `dnf_install_command` can be safely changed to install `python3-dnf`
instead of dnf (which in the future will be provided by DNF5).

This change is especially needed for hosts that have /bin/dnf symlink
provided by dnf5.

Relates: #1084
  • Loading branch information
praiskup authored and xsuchy committed Jun 1, 2023
1 parent 792e200 commit 30f5ce4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions mock/docs/site-defaults.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -472,12 +472,12 @@
# options to always use with the builddep command

# DNF (or DNF4, Python) - https://github.com/rpm-software-management/dnf
#config_opts['dnf_command'] = '/usr/bin/dnf'
#config_opts['dnf_command'] = '/usr/bin/dnf-3'
#config_opts['dnf_common_opts'] = ['--setopt=deltarpm=False', '--allowerasing']
# DF5 sub-command 'builddep' doesn't support the '--allowerasing' option:
# https://github.com/rpm-software-management/dnf5/issues/461
#config_opts["dnf5_avoid_opts"] = {"builddep": ["--allowerasing"]}
#config_opts['dnf_install_command'] = 'install dnf dnf-plugins-core'
#config_opts['dnf_install_command'] = 'install python3-dnf dnf-plugins-core'
#config_opts['dnf_disable_plugins'] = ['local', 'spacewalk', 'versionlock']
#config_opts['dnf_builddep_opts'] = []

Expand Down
7 changes: 4 additions & 3 deletions mock/py/mockbuild/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,14 +294,15 @@ def setup_default_config_opts():
config_opts['system_yum_command'] = '/usr/bin/yum'
config_opts['yum_install_command'] = 'install yum yum-utils'
config_opts['yum_builddep_command'] = '/usr/bin/yum-builddep'
config_opts['system_dnf_command'] = '/usr/bin/dnf'

config_opts['dnf_command'] = '/usr/bin/dnf'
config_opts['dnf_command'] = '/usr/bin/dnf-3'
config_opts['system_dnf_command'] = '/usr/bin/dnf-3'
config_opts['dnf_common_opts'] = ['--setopt=deltarpm=False', '--allowerasing']
config_opts['dnf_install_command'] = 'install dnf dnf-plugins-core'
config_opts['dnf_install_command'] = 'install python3-dnf dnf-plugins-core'
config_opts['dnf_disable_plugins'] = ['local', 'spacewalk', 'versionlock']

config_opts['dnf5_command'] = '/usr/bin/dnf5'
config_opts['system_dnf5_command'] = '/usr/bin/dnf5'
config_opts['dnf5_common_opts'] = ['--setopt=deltarpm=False', '--allowerasing']
config_opts['dnf5_install_command'] = 'install dnf5 dnf5-plugins'
config_opts['dnf5_disable_plugins'] = []
Expand Down

0 comments on commit 30f5ce4

Please sign in to comment.