#3974 Use dnf5-compatible "group install" command
Merged by tkopecek. Opened by tkopecek.
tkopecek/koji issue3971  into  master

Download 3974.patch
  • 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

Not very happy about this. Such mock-config is not working in all cases. E.g. centos6 builder will incorrectly use "group install" in case it is not overriden via tag's extra. I assume it is better to have dnf-like default anyway.

Other options:
1) is to check in kojid's code /etc/mock/site-defaults.cfg and use package_manager from there. Very error-prone
2) Say that "yum" is default unless it is overriden by mock.package_manager - this would be backward-compatible, but it sets the default to something almost obsoleted/
3) Let it be and just encourage admins who still have yum-based builders/envs that they need to update mock.package_manager for all build tags that are still using it.
4) Add tag's extra setting mock.groupinstall (maybe even mock.chroot_setup_cmd template which could leverage "group_name")

@mikem ?

Hmm.

Mock itself still defaults to:

config_opts['chroot_setup_cmd'] = ('groupinstall', 'buildsys-build')

Most mock configs seem to use install @groupname. I distinctly remember this not being an option at some point, but I'm not sure how far back that was. Is it possible that we could use install @build and cover all the cases we care about (or did dnf break that too?)

A casual check suggests that this will work with yum on el6

side note: not the first time groupinstall has been a problem ;)

Historical note. Koji has used groupinstall since Nov 2007. Prior to that, it used install buildsys-build where buildsys-build was an custom generated rpm (see make_groups_spec())

1 new commit added

  • Use 'dnf install @groupname' instead of groupinstall

rebased onto e0665c5a7415f0b31c2680c1fc4d052ee4fa4c0a

+        if opts['package_manager'].endswith('yum'):
+            # backward compatibility with yum (doesn't have separate "group")
+            config_opts['chroot_setup_cmd'] = \
+                'install @%s' % opts.get('install_group', 'build')

This seems to be redundant now

I would like to allow a little time for folks to reply to my last comment on #3971

The yum-compat branch is indeed redundant.

I tested YUM on epel-5 and even that old version seems to have install @group support. I'm not able to easily test anything older than that on a reasonably new Fedora builder.

+1 for this version.

1 new commit added

  • drop redundant code

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

rebased onto cd9762e0fc4f1f595578ebf4cc35cf7db0819814

Metadata Update from @relias-redhat:
- Pull-request untagged with: testing-ready

Metadata Update from @relias-redhat:
- Pull-request tagged with: testing-ready

Metadata Update from @mfilip:
- Pull-request tagged with: testing-done

Commit d5803139 fixes this pull-request

Pull-Request has been merged by tkopecek

Metadata