osbuild-depsolve-dnf5: Fix url substitutions
Substitutions should be set on Base, not per-repo. Discovered this in lorax's dnf5 code so I am updating it here as well.
This commit is contained in:
parent
4f83cdc434
commit
b131d3cf57
1 changed files with 4 additions and 8 deletions
|
|
@ -88,13 +88,12 @@ class Solver():
|
||||||
if not exclude_pkgs:
|
if not exclude_pkgs:
|
||||||
exclude_pkgs = []
|
exclude_pkgs = []
|
||||||
|
|
||||||
# substitutions to use with the repo urls
|
|
||||||
self.substitutions = {
|
|
||||||
"arch": arch,
|
|
||||||
"basearch": _BASEARCH_MAP[arch]
|
|
||||||
}
|
|
||||||
self.base = dnf5.base.Base()
|
self.base = dnf5.base.Base()
|
||||||
|
|
||||||
|
# Base is the correct place to set substitutions, not per-repo.
|
||||||
|
# See https://github.com/rpm-software-management/dnf5/issues/1248
|
||||||
self.base.get_vars().set("arch", arch)
|
self.base.get_vars().set("arch", arch)
|
||||||
|
self.base.get_vars().set("basearch", _BASEARCH_MAP[arch])
|
||||||
|
|
||||||
# Enable fastestmirror to ensure we choose the fastest mirrors for
|
# Enable fastestmirror to ensure we choose the fastest mirrors for
|
||||||
# downloading metadata (when depsolving) and downloading packages.
|
# downloading metadata (when depsolving) and downloading packages.
|
||||||
|
|
@ -217,9 +216,6 @@ class Solver():
|
||||||
if "module_hotfixes" in desc:
|
if "module_hotfixes" in desc:
|
||||||
repo.module_hotfixes = desc["module_hotfixes"]
|
repo.module_hotfixes = desc["module_hotfixes"]
|
||||||
|
|
||||||
# This needs to be set on each repo
|
|
||||||
repo.set_substitutions(self.substitutions)
|
|
||||||
|
|
||||||
# Set the packages to exclude
|
# Set the packages to exclude
|
||||||
conf.excludepkgs = exclude_pkgs
|
conf.excludepkgs = exclude_pkgs
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue