Skip to content

Commit

Permalink
Merge pull request #11 from jpopelka/stream
Browse files Browse the repository at this point in the history
Make metalinks work on CentOS Stream 9
  • Loading branch information
jpopelka authored Oct 2, 2023
2 parents 4417bb0 + f815446 commit 4ca2c1e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ actions:
- "python3 -m build --sdist --outdir ."
- "sh -c 'echo rpmdeplint-$(hatch version).tar.gz'"
get-current-version:
- "hatch version"
- bash -c "hatch version | sed 's|^\([[:digit:]]\.[[:digit:]]\)rc|\1~rc|'"

srpm_build_deps:
- python3-build
Expand Down
14 changes: 8 additions & 6 deletions rpmdeplint/repodata.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,14 @@ class Repo:
@staticmethod
def get_yumvars() -> dict[str, str]:
with suppress(ModuleNotFoundError):
import dnf.conf
import dnf.rpm

subst = dnf.conf.Conf().substitutions
subst["releasever"] = dnf.rpm.detect_releasever(installroot="")
return subst
import dnf

with dnf.Base() as base:
subst = base.conf.substitutions
with suppress(FileNotFoundError):
if "CentOS Stream" in Path("/etc/redhat-release").read_text():
subst["stream"] = f"{subst['releasever']}-stream"
return subst

# Probably not going to work but there's not much else we can do...
return {
Expand Down

0 comments on commit 4ca2c1e

Please sign in to comment.