From 3671774e8a83a33abfd6cf2f507d39131cd68f6e Mon Sep 17 00:00:00 2001 From: Patrick McCarty Date: Mon, 2 Jul 2018 21:38:55 -0700 Subject: [PATCH] Support newer versions of Mock (part 1) In Mock version 1.4.4, the chroot group was changed from "mockbuild" to "mock". This creates a problem for running Mock on Clear Linux because (a) the distro already has group "mock", and (b) Mock tries to `groupdel mock` within the chroot and fails, since the group is defined in /usr/share/defaults/etc/group and not in /etc/group. Mock treats the groupdel failure as fatal. Fortunately there is a workaround: set the "chrootgroup" config to a group not already defined in the OS. I am setting the group to "mockbuild" in the default config to restore the behavior of previous Mock versions. Thanks to Mark Horn for adding this feature upstream! It was merged for Mock 1.4.7. Also, disable the new bootstrap container feature, added in Mock version 1.4.1. It was disabled by default in version 1.4.2, but keep the explicit setting in case upstream enables it in the future. Signed-off-by: Patrick McCarty --- conf/clear.cfg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conf/clear.cfg b/conf/clear.cfg index 48f9402..299b040 100644 --- a/conf/clear.cfg +++ b/conf/clear.cfg @@ -8,6 +8,8 @@ config_opts['useradd'] = '/usr/sbin/useradd -m -u %(uid)s -g %(gid)s -d %(home)s config_opts['plugin_conf']['ccache_enable'] = False config_opts['releasever'] = 'clear' config_opts['package_manager'] = 'dnf' +config_opts['chrootgroup'] = 'mockbuild' +config_opts['use_bootstrap_container'] = False config_opts['dnf.conf'] = """