Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
+++ This bug was initially created as a clone of Bug #1755424 +++
Description of problem:
PackageKit isn't correctly reading in all the vars from /etc/dnf/vars/ (and /etc/yum/vars/)
Version-Release number of selected component (if applicable):
PackageKit-1.1.12-2.el8
How reproducible:
100%
Steps to Reproduce:
1. Create a repo with a local variable in the url path
example
http://mirror.centos.org/$contentdir/$stream/AppStream/x86_64/os/repodata/repomd.xml
2. Define the variables in /etc/dnf/vars
3. dnf makecache
4. pkcon refresh
Actual results:
Fatal error: cannot update repo 'Stream-AppStream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried; Last error: Status code: 404 for http://mirror.centos.org/$contentdir/$stream/AppStream/x86_64/os/repodata/repomd.xml
Expected results:
Variables are expanded in PackageKit in the same manner as dnf
Additional info:
https://github.com/hughsie/PackageKit/issues/339
I tested the patch with microdnf.
The patch fixes only the reported problem. There are known incompatibilities with DNF that are going to be fixed later.
- Variables are read only from files. (DNF also supports reading variables from environment.)
- Variable substitutions are applied only in URLs. (DNF also supports of values substitution in other options.)
- Only "$variable" syntax is supported. (DNF also support "${var_name}" - with braces.)
The problem is more complex. So, I backported only changes needed to solve reported bug.
> PackageKit isn't correctly reading in all the vars from /etc/dnf/vars/ (and /etc/yum/vars/)
There are two implementations for reading variables from files (in DNF and in libdnf) now. And there are two implementations of substitution (in libdnf and librepo).
Our long plan is consolidate of the code (cleaning, remove duplication, ...). That is why known incompatibilities will be fixed later. We are working on it.
Notes:
- To invalidate and reload PackageKit cache after configuration changes is better to use "pkcon refresh force".
- The variables are automatically reloaded after change of any repository configuration file (*.repo) or repository directory (eg. after "touch /etc/yum.repos.d/").
- The reloading of variables can be forced by restarting PackageKit daemon (eg. "systemctl restart packagekit").
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2020:1823