Skip to content
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

DnfContext: add dnf_context_module_install() #1200

Merged

Conversation

jlebon
Copy link
Contributor

@jlebon jlebon commented Apr 19, 2021

This is a C-compatible API similar to dnf_context_module_enable()
which additionally marks the target packages for installation. This is
similar to dnf module install.

We intend to use this in rpm-ostree as well.

Closes: #874

Straight mapping to `modulemd_profile_is_default()`.
This is useful if the profile is unspecified by the user. Match the dnf
semantic of auto-defaulting to the only profile there is.
@jlebon
Copy link
Contributor Author

jlebon commented Apr 19, 2021

Still learning the modular parts of the codebase and my C++ is a bit rusty, so let me know if there are better ways to do some things or bits I'm missing!

libdnf/dnf-context.h Show resolved Hide resolved
@Conan-Kudo
Copy link
Member

@jlebon You'll also want your last commit to include changelog information, per the contribution doc: https://github.com/rpm-software-management/libdnf#contribution

This is a C-compatible API similar to `dnf_context_module_enable()`
which additionally marks the target packages for installation. This is
similar to `dnf module install`.

We intend to use this in rpm-ostree as well.

Closes: rpm-software-management#874

= changelog =
msg: Add new dnf_context_module_install() C API
type: enhancement
resolves: rpm-software-management#874
@jlebon
Copy link
Contributor Author

jlebon commented Apr 20, 2021

Updated! ⬆️

@Conan-Kudo Conan-Kudo merged commit 5b9c9fa into rpm-software-management:dnf-4-master Apr 21, 2021
@j-mracek
Copy link
Contributor

@jlebon I am sorry but it looks like that the code will not work like expected (like dnf) when module stream requested to install is not enabled. @Conan-Kudo May I ask you for a ping when modularity PR appears?

@Conan-Kudo
Copy link
Member

Yep, certainly.

@jlebon
Copy link
Contributor Author

jlebon commented Apr 23, 2021

@jlebon I am sorry but it looks like that the code will not work like expected (like dnf) when module stream requested to install is not enabled.

Thanks for the feedback. Can you expand on the differences between the two? From my understanding, doing dnf module install on a stream which is not already enabled will also enable it. This is also doing that here the same way dnf_context_module_enable does it, no? (I.e. via modify_module_dict_and_enable_stream).

jlebon added a commit to jlebon/libdnf that referenced this pull request Apr 23, 2021
jlebon added a commit to jlebon/libdnf that referenced this pull request Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide C interface for modularity APIs
3 participants