-
Notifications
You must be signed in to change notification settings - Fork 87
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
$releasever substitution not used in GPG key filename #1248
Comments
Can you be more specific how you obtain the PGP filename? I quickly tested it with dnf5-5.1.12-20240213004754.0.gaad06db3.fc40.x86_64 from a command line |
May I ask you whether the repository is created from .repo file or created from API? In case of API approach, may I ask you for the code that you use? |
The filename comes from running lorax with the distribution repo file using The if repos:
reposdir = os.path.join(tempdir, "dnf.repos")
if not os.path.isdir(reposdir):
os.mkdir(reposdir)
for r in repos:
shutil.copy2(r, reposdir)
conf.reposdir = reposdir The code adding the basearch and releasever is here - https://github.com/weldr/lorax/blob/master/src/pylorax/dnfbase.py#L214 # Make sure there are enabled repos
rq = dnf5.repo.RepoQuery(dnfbase)
rq.filter_enabled(True)
if len(rq) == 0:
log.error("No enabled repos")
return None
log.info("Using repos: %s", ", ".join(r.get_id() for r in rq))
# Add substitutions to all enabled repos
for r in rq:
# Substitutions used with the repo url
r.set_substitutions({
"releasever": releasever,
"basearch": basearch,
}) And I wasn't using ETA: Adam came up with a fix for this that does seem to work in my testing - weldr/lorax#1380 |
Thank you for the link to code. It seems that you modify substitutions to late and on incorrect place. Substitutions are applied at the time of loading repositories. Any modification after that point does not modify anything in repository. |
Because there is a patch in lorax that fix the issue, I am closing this report. |
Ah, ok. Oddly enough though, this did work when substituting the baseurl/mirrorlist. I'd have noticed sooner if it was a complete failure :) |
We have a plan to add locking substitution, but it is on TODO list. |
Fedora hit this problem after branching: weldr/lorax#1379
I forget the exact series of events, but lorax is setting the
basearch
andreleasever
substitutions for each repo. ISTR having problems either finding how to set them or getting them to work at the time. Adam fixed this by setting it on Base().get_vars() so that appears to be a more correct way to do this and I'll switch to that after we confirm it works.But I think this is still a bug, the gpg key filename should also be using the repo's variables if they exist.
And the documentation around
.get_vars()
could be improved, it's possible that I completely missed what it could be used for because it doesn't mention variable substitution in a way that I would search for.The text was updated successfully, but these errors were encountered: