Description of problem: When trying to test conditional installation expressions with "dnf install", it seems like DNF is basically ignoring the expression and requesting to install the package anyway. In particular, I want to use this for a firstboot service to only install some packages conditionally. In particular, gstreamer1-plugin-openh264 and mozilla-openh264 right now, and possibly third-party hardware drivers in the future. I vaguely recall that this used to work (I remember using it to test rich dep expressions in the past for package development), but it does not work properly now and always requests to install the packages. Version-Release number of selected component (if applicable): 4.8.0-2.fc35 How reproducible: Always Steps to Reproduce: 1. Run "dnf --assumeno install '(gstreamer1-plugin-openh264 if gstreamer1-plugins-base)' '(mozilla-openh264 if mozilla-filesystem)'" Actual results: DNF proposes to install gstreamer1-plugin-openh264 and mozilla-openh264. Expected results: DNF does not propose to install anything if gstreamer1-plugins-base and mozilla-filesystem are not installed. If gstreamer1-plugins-base is installed, it will propose to install gstreamer1-plugin-openh264. If mozilla-filesystem is installed, it will propose to install mozilla-openh264. If both are installed, then it'll propose to install gstreamer1-plugin-openh264 and mozilla-openh264. Additional info: We want to use this for auto-installing OpenH264 in desktop Fedora variants after initial installation. See https://pagure.io/fedora-workstation/issue/84 for more details.
Thanks for the report. The problem is related to how we resolve arguments from commandline to packages in first place and then we ask to install those packages. We can improve it and try something like: when arguments start with '(' then do goal install provide of argument. This approach has some disadvantages. It will not work for globs and when multiarch_policy=all, because it will install only one architecture. Also there will be a problem with reports of no much found, but it can be workarrounded by creating query like always, but result will be used only for report and not for goal. Anyway the request is valid but I would prefer to resolve it in DNF5.
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle. Changing version to 36.
This message is a reminder that Fedora Linux 36 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora Linux 36 on 2023-05-16. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of '36'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, change the 'version' to a later Fedora Linux version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see it. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora Linux 36 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora Linux, you are encouraged to change the 'version' to a later version prior to this bug being closed.
The issue is fixed in DNF5 for install command (only). DNF5 is available in Fedora 38+ therefore I consider the request as resolved. We don't have a plan to provide a patch for DNF4 therefore I am closing the bug.