From cce2646a1e9a330b4cbf675f97da9c244e6288fb Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Mon, 24 Jul 2023 09:40:46 +0200 Subject: [PATCH] Use 'allow_vendor_change=yes' with DNF and DNF5 The `allow_vendor_change=no` option is going to be set in DNF5 as default: https://github.com/rpm-software-management/dnf5/issues/712 But it is also set by openSUSE with DNF4. With Mock though, is very common to override the distro default package with a custom one (newer or fixed packages?). And blindly trying to keep the Vendor tag unchanged for the overridden packages would be very complicated task, without real benefits. Note `allow_vendor_change=no` only affects the cases when some package in the buildroot/bootstrap needs to be _updated_ while _typically_ all the packages are only _installed_ at the beginning and are already up2date. This is therefore mainly related to the --chain option, or cases like `bootstrap_image_ready=False`, `update_before_build`, the feature in #1159, etc. Fixes: #1155 --- mock/docs/site-defaults.cfg | 4 ++-- mock/py/mockbuild/config.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mock/docs/site-defaults.cfg b/mock/docs/site-defaults.cfg index a1af82910..b5051b415 100644 --- a/mock/docs/site-defaults.cfg +++ b/mock/docs/site-defaults.cfg @@ -487,7 +487,7 @@ # DNF (or DNF4, Python) - https://github.com/rpm-software-management/dnf #config_opts['dnf_command'] = '/usr/bin/dnf-3' -#config_opts['dnf_common_opts'] = ['--setopt=deltarpm=False', '--allowerasing'] +#config_opts['dnf_common_opts'] = ['--setopt=deltarpm=False', '--setopt=allow_vendor_change=yes', '--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"]} @@ -499,7 +499,7 @@ # Known issue with DNF5: --forcearch is not supported by DNF5 # https://github.com/rpm-software-management/dnf5/issues/112 #config_opts['dnf5_command'] = '/usr/bin/dnf5' -#config_opts['dnf5_common_opts'] = ['--setopt=deltarpm=False', '--allowerasing'] +#config_opts['dnf5_common_opts'] = ['--setopt=deltarpm=False', '--setopt=allow_vendor_change=yes', '--allowerasing'] #config_opts['dnf5_install_command'] = 'install dnf5 dnf5-plugins' #config_opts['dnf5_disable_plugins'] = [] diff --git a/mock/py/mockbuild/config.py b/mock/py/mockbuild/config.py index 1ba9ce170..ba4dad6c1 100644 --- a/mock/py/mockbuild/config.py +++ b/mock/py/mockbuild/config.py @@ -299,14 +299,14 @@ def setup_default_config_opts(): 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_common_opts'] = ['--setopt=deltarpm=False', '--setopt=allow_vendor_change=yes', '--allowerasing'] config_opts['dnf_install_command'] = 'install python3-dnf python3-dnf-plugins-core' config_opts['dnf_disable_plugins'] = ['local', 'spacewalk', 'versionlock'] config_opts["dnf_avoid_opts"] = {} 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_common_opts'] = ['--setopt=deltarpm=False', '--setopt=allow_vendor_change=yes', '--allowerasing'] config_opts['dnf5_install_command'] = 'install dnf5 dnf5-plugins' config_opts['dnf5_disable_plugins'] = [] # No --allowerasing with remove, per