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

many: enable support for librepo based rpm downloading #1132

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

mvo5
Copy link
Contributor

@mvo5 mvo5 commented Jan 8, 2025

[draft as it is light on tests and also needs osbuild pr#1974 first]

This PR adds support for (optional) librepo based rpm downloading. It can be controlled when generating the manifest via the new RpmDownloader iota. This needs osbuild PR#1974.

Note that this PR implements manifest.Manifest.SerializeFull() which I think we do not want in the final PR, I did that just to keep the size of the PR low so that validating the approach is easier.

mvo5 added 5 commits January 9, 2025 13:10
This commit adds the two new `Path` and `RepoID` fields to the
rpmmd.PackageSpec so that librepo can use them as it needs to
correlate a package to a repo to generate the right mirror id.
This commit adds a wrapper for the org.osbuild.librepo source
to download RPMs.
This commit enables librepo sources generation. Currently guarded
behind a hacky OSBUILD_USE_LIBREPO environment.
This commit changes the signature of `SerializeFull()` to take a new
`Inputs` struct and a new `Options` struct. The `inputs` make it
easier to extend the function as for new inputs the signature
no longer needs to change. And `options` allows us to pass extra
paramters like what rpm downloader to use.

Note that this keeps a compatibility Serialize() for now, mostly
to avoid churn in this PR but we definitely want to clean this
up and fix the callers.
This commit enables to select what rpm downloader backend to use.
The signature of GenSources() is just expanded to take an additonal
parameter. It would be nice to re-use the `manifest.Inputs` struct
but it is (subtly) different from what GenSource needs :/ I was
also tempated to add a "Options" struct to GenSources instead of
the enum but YAGNI - if we ever need to add another one this will
become a options struct.
@thozza thozza force-pushed the librepo-sources-osbuild1974 branch from dae4acd to 63df312 Compare January 9, 2025 12:10
@thozza
Copy link
Member

thozza commented Jan 9, 2025

Rebased due to image build cache layout change (#1130)

@achilleas-k achilleas-k self-requested a review January 9, 2025 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants