-
Notifications
You must be signed in to change notification settings - Fork 103
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
Install spec implementation #225
Conversation
13f0158
to
d9e3532
Compare
e03fbbd
to
a39689f
Compare
/// High level API for an artifact reinstall. See `add_install()` for details. | ||
/// @param spec A string with reinstall spec | ||
/// @param settings A structure to override default goal settings. | ||
void add_reinstall(const std::string & spec, const libdnf::GoalJobSettings & settings = libdnf::GoalJobSettings()); |
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.
Reinstall and downgrade operation was not supported by DNF4. With groups it somehow make sene, but with module I am really nor sure what it is supposed to do (too many edge cases).
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.
There was an assert preventing libdnf to perform some actions on groups. Actually currently only INSTALL and REMOVE actions are supported.
I've added commits to change this assert and a resolve log is written instead.
New API method add_cmdline_packages accepts a vector of local rpm file paths or URLs of remote rpms. The remote packages are downloaded and all are inserted into cmdline repository. Currently filling of the cmdline repository is responsibility of the user which leads to code duplication - each client needs to implement it's own download methods.
This implements install/reinstall/upgrade/downgrade/remove actions on any artifact using the same high level API functions goal.add_*(spec). The spec here can be - a repository package specification matched against NEVRA, provides, and file provides, e.g. "wget", "vim-*" - a local rpm file (/the/location/package.rpm) - a URL of remote rpm package - using '@' prefix also a group can be specified - @rpm-development-tools - TODO: once installation of environmental groups and modules is implemented, also these artifact will be fully supported
With new goal.add_*(spec) API usage dnf5 does not need to fill cmdline repo any more.
Adding packages to cmdline repo was moved to RepoSack.
With new API to add packages to cmdline repo there is no external user for this method.
This problem is logged if user wants to perform goal action, which is not supported - e.g. downgrading a group.
Now with the install spec there is a way for the API users to ask libdnf to perform unsupported operations - for example `goal.add_downgrade('@group_id')`. We need to inform the user what's wrong instead of throwing an exception.
a39689f
to
21b37bc
Compare
Hm, some CI tests started failing. I need to investigate it. |
In case dnf was downloading some remote rpm files from URL, the transaction table was printed right on the last line of the multiprogress bar.
6df8b75
to
165b73c
Compare
Thank you for the PR and cooperation. |
New high level API for installing any artifact using the same simple call goal.add_install(spec).
The spec here can be