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

Install spec implementation #225

Merged
merged 9 commits into from
Jan 20, 2023
Merged

Install spec implementation #225

merged 9 commits into from
Jan 20, 2023

Conversation

m-blaha
Copy link
Member

@m-blaha m-blaha commented Jan 10, 2023

New high level API for installing any artifact using the same simple call goal.add_install(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
  • by 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 able to be installed

@m-blaha m-blaha force-pushed the mblaha/install_spec branch 2 times, most recently from 13f0158 to d9e3532 Compare January 12, 2023 11:07
@m-blaha m-blaha marked this pull request as ready for review January 12, 2023 11:08
@m-blaha m-blaha requested review from j-mracek and jrohel January 12, 2023 11:09
@m-blaha m-blaha force-pushed the mblaha/install_spec branch 2 times, most recently from e03fbbd to a39689f Compare January 16, 2023 11:51
@mcurlej mcurlej added this to the Fedora 38 milestone Jan 18, 2023
@jrohel jrohel self-assigned this Jan 19, 2023
/// 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());
Copy link
Contributor

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).

Copy link
Member Author

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.
@m-blaha m-blaha force-pushed the mblaha/install_spec branch from a39689f to 21b37bc Compare January 19, 2023 16:35
@m-blaha
Copy link
Member Author

m-blaha commented Jan 20, 2023

Hm, some CI tests started failing. I need to investigate it.

@m-blaha m-blaha added blocked Further work on issue or PR is blocked by something else and removed ready for review labels Jan 20, 2023
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.
@jrohel jrohel force-pushed the mblaha/install_spec branch from 6df8b75 to 165b73c Compare January 20, 2023 08:55
@m-blaha m-blaha added ready for review and removed blocked Further work on issue or PR is blocked by something else labels Jan 20, 2023
@jrohel
Copy link
Contributor

jrohel commented Jan 20, 2023

Thank you for the PR and cooperation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants