You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.9 KiB
44 lines
1.9 KiB
11 months ago
|
From 36953540662aa39ff1b85218cefededfa4e529a9 Mon Sep 17 00:00:00 2001
|
||
|
From: Tomas Kopecek <tkopecek@redhat.com>
|
||
|
Date: Jan 15 2024 12:48:16 +0000
|
||
|
Subject: Use dnf5-compatible "group install" command
|
||
|
|
||
|
|
||
|
* yum knows only "yum groupinstall"
|
||
|
* dnf < 5 knows both
|
||
|
* dnf-5 only "dnf5 group install"
|
||
|
|
||
|
It is reasonable to assume that dnf is used in most setups, so changing
|
||
|
default to "group install". If yum is specified *explicitly* via
|
||
|
tags's extra "mock.package_manager", "groupinstall" is used instead.
|
||
|
|
||
|
Related: https://pagure.io/koji/issue/3971
|
||
|
|
||
|
---
|
||
|
|
||
|
diff --git a/koji/__init__.py b/koji/__init__.py
|
||
|
index 334b403..9b222cd 100644
|
||
|
--- a/koji/__init__.py
|
||
|
+++ b/koji/__init__.py
|
||
|
@@ -1804,7 +1804,7 @@ def genMockConfig(name, arch, managed=False, repoid=None, tag_name=None, **opts)
|
||
|
'target_arch': opts.get('target_arch', arch),
|
||
|
'chroothome': '/builddir',
|
||
|
# Use the group data rather than a generated rpm
|
||
|
- 'chroot_setup_cmd': 'groupinstall %s' % opts.get('install_group', 'build'),
|
||
|
+ 'chroot_setup_cmd': 'group install %s' % opts.get('install_group', 'build'),
|
||
|
# don't encourage network access from the chroot
|
||
|
'rpmbuild_networking': opts.get('use_host_resolv', False),
|
||
|
'use_host_resolv': opts.get('use_host_resolv', False),
|
||
|
@@ -1817,6 +1817,10 @@ def genMockConfig(name, arch, managed=False, repoid=None, tag_name=None, **opts)
|
||
|
config_opts['forcearch'] = opts['forcearch']
|
||
|
if opts.get('package_manager'):
|
||
|
config_opts['package_manager'] = opts['package_manager']
|
||
|
+ if opts['package_manager'].endswith('yum'):
|
||
|
+ # backward compatibility with yum (doesn't have separate "group")
|
||
|
+ config_opts['chroot_setup_cmd'] = \
|
||
|
+ 'groupinstall %s' % opts.get('install_group', 'build')
|
||
|
if opts.get('bootstrap_image'):
|
||
|
config_opts['use_bootstrap_image'] = True
|
||
|
config_opts['bootstrap_image'] = opts['bootstrap_image']
|
||
|
|