Commit graph

6 commits

Author SHA1 Message Date
Michael Vogt
65a7ce2461 sources: relax "mirror" regexp to follow upstream repo ID
This commit relaxes the "mirror" schema regex from only allow
hashes to the repo ID regex as described in
https://dnf.readthedocs.io/en/latest/conf_ref.html#description

This is needed because in e.g. bootc-image-builder we use
"SetRootDir()" to get the repository information from an existing
bootc image and there the repo_id (that is then used as the mirror_id)
is written in a human friendly way instead of hex.

Thanks to Tomáš Hozza for the suggestions and background info, see
https://github.com/osbuild/osbuild/pull/1974#issuecomment-2579325272
2025-01-14 08:19:16 +01:00
Michael Vogt
b2a34d8b33 sources: add org.osbuild.mtls secret support to librepo source
This commit adds support for the `org.osbuild.mtls` sources and
adds a test.

Note that it reuses the `OSBUILD_SOURCES_CURL_` - this may or
may not be desired, it is certainly simpler this way and librepo
is using libcurl as well internally but it feels a bit messy so
maybe we want to rename the env?
2025-01-14 08:19:16 +01:00
Michael Vogt
a90ad5c432 sources: add simple status printing like curl to librepo 2025-01-14 08:19:16 +01:00
Michael Vogt
2ba797a18c sources: tweak fetch_all and fix pylint error
This commit fixes the pylint errors and as a drive-by tweaks some naming
in `fetch_all()`. Maybe they became a bit verbose along the way,
idk.

Thanks also to Tomáš Hozza for the dict.setdefault() suggestion.
2025-01-14 08:19:16 +01:00
Michael Vogt
a0b4445f3b sources: add unit tests for org.osbuild.librepo
This commit adds unit a basic test for librepo and also updates
the code to the latest requirements to provide "fetch_all".

It also fixes a bug in the handling of org.osbuild.rhsm secrets.
2025-01-14 08:19:16 +01:00
Brian C. Lane
28e74f6c9b Add support for using librepo to download packages
Using a metalink or mirrorlist along with the package paths and
checksums allows them to be reliably downloaded even when mirrors are
not all in sync. It will retry with a new mirror until it succeeds, or
has tried all of the mirrors.
2025-01-14 08:19:16 +01:00