Skip to content

Conversation

@l-austenfeld
Copy link

This commit fixes the EPEL repository meta-links.

There where two problems:

  • The link is different when a minor version is specified as well (i.e. 10.1 instead of just 10)
  • The names for the testing repos was wrong

The links can be confirmed by looking in the /etc/yum.repos.d/epel.repo and /etc/yum.repos.d/epel-testing.repo files on a system with the epel-release package installed.

The changes can be tested with this mkosi.conf:

[Distribution]
Distribution=rocky
Release=10.1
RepositoryKeyFetch=yes
Repositories=epel epel-testing

Comment on lines +311 to +314
if GenericVersion(context.config.release) >= 10:
repo_extra_part = "-z"
else:
repo_extra_part = ""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can shorten this a bit

Suggested change
if GenericVersion(context.config.release) >= 10:
repo_extra_part = "-z"
else:
repo_extra_part = ""
repo_extra_part = "-z" if GenericVersion(context.config.release) >= 10 else ""

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I forgot about ternary expressions. Will fix that.

else:
url = "metalink=https://mirrors.fedoraproject.org/metalink?arch=$basearch"

if GenericVersion(context.config.release) >= 10:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when 11 is released? It'll use the -z suffix as well then, which it probably shouldn't?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are some version parsing functions already in use in the code somewhere, I will see if I can just use those to check for the presence of a minor version.
I think this could already be a problem with just version 10 alone, but that never worked in my tests before (it tries to mix Rocky's 10.1 and EPEL's 10.2 repos and fails) so I can't really confirm.

Comment on lines 341 to 358
yield RpmRepository(
"epel-testing",
f"{url}&repo=testing-epel{release}",
f"{url}&repo=epel{repo_extra_part}-testing-{release}",
gpgurls,
enabled=False,
)
yield RpmRepository(
"epel-testing-debuginfo",
f"{url}&repo=testing-debug-epel{release}",
f"{url}&repo=epel{repo_extra_part}-testing-debug-{release}",
gpgurls,
enabled=False,
)
yield RpmRepository(
"epel-testing-source",
f"{url}&repo=testing-source-epel{release}",
f"{url}&repo=epel{repo_extra_part}-testing-source-{release}",
gpgurls,
enabled=False,
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you double checked this also works with centos 9?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not think to test older versions, that is a good point. Is there and existing test suite I can just run to check this specific thing or should I write my own? Also if I have to write my own (I am assuming a handful of mkosi.conf files is enough) is there a good place to put that, so that future problems can be detected sooner?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The integration test system is in dire need of a revamp, so a manual test will suffice for now.

@l-austenfeld l-austenfeld changed the title distribution: fix epel repo metalinks WIP: distribution: fix epel repo metalinks Jan 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants