On Tue, Jun 22, 2021 at 09:10:52AM +0200, Florian Weimer wrote:
* Zbigniew Jędrzejewski-Szmek:
>> glibc-gconv-extra is recommended by glibc, so a regular update or
>> default installation should pull in glibc-gconv-extra and there should
>> be no noticeable change unless a user explicitly removes
>> glibc-gconv-extra at some point.
>
> To preserve compatibility on upgrades, you should have
> Obsoletes:glibc < $NEW_VERSION in both glibc and glibc-gconv-extra.
> This causes dnf to install both packages when updating. This should
> be present independently of the Recommends and conditional Requires,
> which are mostly for new systems.
I saw glibc-gconv-extra being installed during updates with the current
set of dependencies.
Yes, because you have a conditional Requires on redhat-rpm-config, and
you most likely have redhat-rpm-config, because it in turn is Required
by many packages.
But not all systems have to have it, and people might also have
install_weak_deps=False in dnf.conf. Then the thing with Obsoletes
becomes useful. (Effectively, if the system had certain functionality
before the upgrade, it retains it after the upgrade, w/o the admin
having to make any manual steps.)
It's the first time I read about this Obsoletes: stuff.
Wouldn't it
cause deinstallation of glibc.i686 during updates that bring in
glibc-gconv-extra.x86_64? If not, where can we find documentation how
this is supposed to work?
The Obsoletes is versioned. So in principle dnf should notice that it
needs to install new versions of glibc.x86_64 *and* glibc.i686. But this
is a rather complex case, so I recommend triple-testing the whole thing ;)
See
https://bugzilla.redhat.com/show_bug.cgi?id=1261034 for some gory
history. I'm not sure if there's better documentation.
https://src.fedoraproject.org/rpms/systemd/c/f455b2249ac56d83b05ae75ebfc8...
is an example of handling of a split in systemd when systemd-networkd was split out.
I test this by building the packages in mock, and then calling
'sudo dnf upgrade /var/lib/mock/*/results/*[46h].rpm'. When the
Obsoletes are done correctly, the split-out subpackage will be added
to the transaction.
One common mistake I do is forgetting to bump the version in Obsoletes
on the main package.
Zbyszek