Bug 1756382
| Summary: | [libdnf] PackageKit's DNF backend doesn't apply all variable substitutions. | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Daniel Mach <dmach> |
| Component: | libdnf | Assignee: | Jaroslav Rohel <jrohel> |
| Status: | CLOSED ERRATA | QA Contact: | Eva Mrakova <emrakova> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | urgent | ||
| Version: | 8.0 | CC: | amatej, desktop-qa-list, dvolkov, emrakova, hasuzuki, jkoten, jrohel, klember, pasik, rhughes, riehecky |
| Target Milestone: | rc | Keywords: | Triaged |
| Target Release: | 8.0 | Flags: | pm-rhel:
mirror+
|
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | libdnf-0.38.1-1.el8 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | 1755424 | Environment: | |
| Last Closed: | 2020-04-28 16:48:23 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | 1755424 | ||
| Bug Blocks: | |||
|
Description
Daniel Mach
2019-09-27 13:45:33 UTC
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.)
I'm a bit surprised by some of these limitations.... For "Variables are read only from files. (DNF also supports reading variables from environment.)" An earlier PR seems to have the relevant functions https://github.com/rpm-software-management/libdnf/pull/748/files#diff-1c835575752738fff3fff22f4a33fabbR622 For "Only "$variable" syntax is supported. (DNF also support "${var_name}" - with braces.)" Couldn't `ConfigParser::substitute` be used for the actual substitions? https://github.com/rpm-software-management/libdnf/blob/master/libdnf/conf/ConfigParser.cpp#L29 I'd probably want to move `ConfigParser::substitute` into perhaps `utils` so it is a bit more universal though.... 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.
*** Bug 1767345 has been marked as a duplicate of this bug. *** 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"). *** Bug 1755424 has been marked as a duplicate of this bug. *** 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 |