Three templates try to use this style:
[adamw@xps13a fedora-kiwi-descriptions (main)]$ grep -R "ignore name" | grep "@" components/desktops/lxqt.xml: <ignore name="@input-methods"/> components/desktops/lxqt.xml: <ignore name="@admin-tools"/> components/desktops/mate.xml: <ignore name="@3d-printing"/> components/desktops/mate.xml: <ignore name="@admin-tools"/> components/desktops/mate.xml: <ignore name="@mate-applications"/> components/desktops/soas.xml: <ignore name="@gnome-desktop"/>
This is translated from kickstarts that did -@(groupname). But it just does not work in Kiwi.
-@(groupname)
In kickstart/anaconda context, it means "leave out this group that would otherwise be pulled in as part of an environment group". But in Kiwi context, it just gets converted into a --exclude arg to dnf, and dnf does not accept group specifiers for --exclude. It just ignores them.
--exclude
So for instance, in the lxqt case, what we're trying to do is "include the lxqt-desktop-environment environment group, but leave out the admin-tools and input-methods groups, which it would usually pull in". But that gets translated into these dnf args:
lxqt-desktop-environment
admin-tools
input-methods
--exclude=@admin-tools --exclude=@input-methods install @lxqt-desktop-environment
...and if you run that, with either dnf4 or dnf5, it goes ahead and includes input-methods and admin-tools. The exclude args are read only as package specifiers, they cannot be group specifiers. There's no package named @admin-tools or @input-methods, so they do nothing.
So, these just aren't working right (and the lxqt case actually causes builds to fail ATM). We need to change them somehow.
I don't know if it's possible to actually achieve with Kiwi/dnf what we could achieve with kickstarts, here. Something in the pykickstart/anaconda chain must have been doing the environment group resolution itself or something. I can look into that a bit later. Gotta go out now.
I wonder if DNF doesn't offer a CLI equivalent of the API used by livecd-tools and anaconda?
For livecd-tools, we compute the final group list based on environment minus excluded groups. I guess DNF doesn't do that.
It looks to me like anaconda here ultimately routes through python-dnf (that's the one from old dnf, not dnf5) base.Base.install_specs - anaconda gathers the include and exclude specs from kickstart or user's selections or whatever, and ships them over to dnf, here - _resolve_selection() calls self._dnf_manager.apply_specs(self._include_list, self._exclude_list), which just calls self._base.install_specs() on the lists it's passed.
base.Base.install_specs
_resolve_selection()
self._dnf_manager.apply_specs(self._include_list, self._exclude_list)
self._base.install_specs()
Looking at install_specs, it does indeed seem to allow both package and group specs in both include and exclude lists. Here, it calls self._categorize_specs(install, exclude), which parses both lists into package specs and group specs and returns them, and then install_specs does indeed do stuff with exclude_specs.grp_specs - i.e. the group specs in the exclude list. It seems to get the list of included groups and call it no_match_module_specs (weird name but this is all to do with module stuff which I don't care to figure out), then pass it along with the list of excluded group specs to self._install_groups, which reconciles them as you'd expect.
install_specs
self._categorize_specs(install, exclude)
exclude_specs.grp_specs
no_match_module_specs
self._install_groups
So...arguably, since old-dnf exposed this functionality through the API, we'd have an argument that it should also allow it through the CLI. For dnf5 it's a bit less clear (I've no idea if there's any way to do this through the libdnf or libsolv APIs).
I guess we can at least file an RFE against dnf5 requesting that --exclude be enhanced to accept and handle group specs in this way.
Yeah, that's definitely the route to go. We should have it added to dnf4 and dnf5's --exclude semantics.
Filed https://github.com/rpm-software-management/dnf5/issues/1910 .
Log in to comment on this ticket.