New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DnfTool for using dnf package manager #5791
Conversation
This is required for Fedora starting with Fedora 31 as yum will be removed. Added Redhat and Centos distributions for future-proofing.
Other systems don't always use dnf and might need more precise adjustements.
I'm only dealing with Fedora now, other systems don't always have |
I've open a PR in your fork @ShadowMitia please merge and we will merge here later. |
Feature/dnftool
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ShadowMitia and @lasote for the implementation. Just consider the suggestion about the comment, but it can be merged.
It requires adding DNF
to the docs (should be listed here https://docs.conan.io/en/latest/reference/conanfile/methods.html#systempackagetool) and also an entry in the changelog to know that Fedora now will use dnf
first and fallback to yum
.
@@ -150,6 +157,18 @@ def system_package_tool_test(self): | |||
spt.update() | |||
self.assertEqual(runner.command_called, "sudo -A apt-get update") | |||
|
|||
# Fake a dnf exe and check if for fedora it used it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok leaving the fake executable, but we can leave a FIXME so anyone motivated can improve it mocking the system call.
# Fake a dnf exe and check if for fedora it used it | |
# Fake a dnf executable and check Fedora uses it. # FIXME: Mock which("dnf") function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would say Mock which("dnf") function
if you dare. I'm pleased if you explain it to me how to do it.
This is required for Fedora starting with Fedora 31 as yum will be removed.
Added Redhat and Centos distributions for future-proofing.
Haven't been able to run the tests properly yet. There might be things missing still.
Changelog: Feature: Support for DNF system package manager (Fedora 31+ and others) when present.
Docs: conan-io/docs#1462