Bug 1405783 - mock: Does not use DNF to set up Fedora build roots
Summary: mock: Does not use DNF to set up Fedora build roots
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: mock
Version: epel7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Suchý
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-18 12:29 UTC by Florian Weimer
Modified: 2017-01-20 20:47 UTC (History)
7 users (show)

Fixed In Version: mock-1.3.3-1.fc25 mock-1.3.3-1.fc24 mock-1.3.3-1.el7 mock-1.3.3-1.el6
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-06 07:52:14 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Florian Weimer 2016-12-18 12:29:06 UTC
Description of problem:

mock ignores the --dnf command line option and

config_opts['package_manager'] = 'dnf'

in the mock configuration files.

This is problematic because the result is an unrealistic Fedora chroot which does not match what the Fedora builders use.

Version-Release number of selected component (if applicable):

mock-1.2.21-1.el7.noarch

How reproducible:

Always.

Steps to Reproduce:
1. mock --dnf -r fedora-25-x86_64 --init

Actual results:

chroot is built using yum.

Expected results:

chroot is built using dnf.

Comment 1 Miroslav Suchý 2016-12-19 08:29:26 UTC
Are you sure you have DNF installed on your EL7?

Comment 2 Florian Weimer 2016-12-19 08:47:24 UTC
(In reply to Miroslav Suchý from comment #1)
> Are you sure you have DNF installed on your EL7?

Yes, dnf-0.6.4-2.el7.noarch is installed (the latest from EPEL).

Comment 3 Miroslav Suchý 2016-12-19 10:22:21 UTC
Looking into code we have there:

    if pm == 'yum':
        return Yum(config_opts, chroot, plugins)
    elif pm == 'dnf':
        (distribution, version) = distro.linux_distribution(full_distribution_name=False)[0:2]
        if distribution in ['redhat', 'centos']:
            version = int(version.split('.')[0])
            if version < 8:
                if 'dnf_warning' in config_opts and config_opts['dnf_warning']:
                    print("""WARNING! WARNING! WARNING!
You are building package for distribution which use DNF. However your system
does not support DNF. You can continue with YUM, which will likely succeed,
but the result may be little different.
You can suppress this warning when you put
  config_opts['dnf_warning'] = False
in Mock config.""")
                    input("Press Enter to continue.")
                return Yum(config_opts, chroot, plugins)
        return Dnf(config_opts, chroot, plugins)


So this was intentional. As in time of writing this code there were no DNF available for EL. I suppose that we can add check for existence of /usr/bin/dnf now.

BTW: you should get the warning above. Unless you *manually* insert
  config_opts['dnf_warning'] = False
in your config.

Comment 4 Florian Weimer 2016-12-19 10:29:09 UTC
(In reply to Miroslav Suchý from comment #3)

> So this was intentional. As in time of writing this code there were no DNF
> available for EL. I suppose that we can add check for existence of
> /usr/bin/dnf now.

Ugh.  Certainly it would have been better to strip these settings from the configuration files and manual page on EPEL because everything gives the impression this is supported.

The question is what constructs more broken buildroots, the outdated DNF version in EPEL, or yum.

> BTW: you should get the warning above. Unless you *manually* insert
>   config_opts['dnf_warning'] = False
> in your config.

No, the warning is disabled by default because the configuration key is not set.

Comment 5 Miroslav Suchý 2016-12-19 11:47:01 UTC
Fixed in commit 4c3a51fba9c48aec7b148e81ca2b50f5280b0b8f

Comment 6 Fedora Update System 2017-01-01 12:25:34 UTC
mock-1.3.3-1.el6 has been submitted as an update to Fedora EPEL 6. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-1c15f1fddc

Comment 7 Fedora Update System 2017-01-01 12:26:07 UTC
mock-1.3.3-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2017-5947ef9fd1

Comment 8 Fedora Update System 2017-01-01 12:26:40 UTC
mock-1.3.3-1.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-77cb570c74

Comment 9 Fedora Update System 2017-01-01 12:27:12 UTC
mock-1.3.3-1.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-3b5bb282f4

Comment 10 Fedora Update System 2017-01-02 00:46:44 UTC
mock-1.3.3-1.el6 has been pushed to the Fedora EPEL 6 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-1c15f1fddc

Comment 11 Fedora Update System 2017-01-02 00:48:26 UTC
mock-1.3.3-1.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-3b5bb282f4

Comment 12 Fedora Update System 2017-01-02 01:20:11 UTC
mock-1.3.3-1.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-77cb570c74

Comment 13 Fedora Update System 2017-01-02 01:50:29 UTC
mock-1.3.3-1.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-5947ef9fd1

Comment 14 Fedora Update System 2017-01-06 07:52:14 UTC
mock-1.3.3-1.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2017-01-09 01:21:03 UTC
mock-1.3.3-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 16 Fedora Update System 2017-01-16 17:22:07 UTC
mock-1.3.3-1.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.

Comment 17 Fedora Update System 2017-01-20 20:47:56 UTC
mock-1.3.3-1.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.