Bug 2321990 - The spec file lacks some xinit conditional judgments
Summary: The spec file lacks some xinit conditional judgments
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: ibus
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: fujiwara
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-10-27 06:18 UTC by Fxzx micah
Modified: 2025-12-14 05:47 UTC (History)
3 users (show)

Fixed In Version: ibus-1.5.31~rc1-2.fc41 ibus-1.5.30-7.fc40
Clone Of:
Environment:
Last Closed: 2024-11-02 02:24:46 UTC
Type: ---
Embargoed:
tfujiwar: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker FC-1333 0 None None None 2024-11-01 14:50:16 UTC

Description Fxzx micah 2024-10-27 06:18:33 UTC
I believe the %post section should be written as follows:

%if %{with xinit}
%post
%else
%post xinit
%endif
%{_sbindir}/alternatives --install %{_sysconfdir}/X11/xinit/xinputrc xinputrc %{_xinputconf} 83 || :

Perhaps the %postun section also needs to be updated accordingly? I'm not really sure.

Reproducible: Always

Steps to Reproduce:
none
Actual Results:  
none

Expected Results:  
none

none

Comment 1 Fxzx micah 2024-10-31 03:31:06 UTC
Sorry, the changes I proposed are for f40 and do not apply to f41 and later branches.
Subsequent branches should be modified as appropriate.

Comment 2 fujiwara 2024-10-31 11:28:56 UTC
Thank you for the suggestion.

Seems your patch is needed for f40.

For f41:
%post xinit
%{_sbindir}/alternatives --install %{_sysconfdir}/X11/xinit/xinputrc xinputrc %{_xinputconf} 83 || :

Comment 3 Fxzx micah 2024-10-31 13:20:15 UTC
Looks fine.

Comment 4 Fedora Update System 2024-10-31 14:55:58 UTC
FEDORA-2024-01763b95cb (ibus-1.5.31~rc1-2.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-01763b95cb

Comment 5 Fedora Update System 2024-10-31 14:55:59 UTC
FEDORA-2024-f564837cb2 (ibus-1.5.30-7.fc40) has been submitted as an update to Fedora 40.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-f564837cb2

Comment 6 Fedora Update System 2024-11-01 01:36:01 UTC
FEDORA-2024-01763b95cb has been pushed to the Fedora 41 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-01763b95cb`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-01763b95cb

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2024-11-01 02:37:30 UTC
FEDORA-2024-f564837cb2 has been pushed to the Fedora 40 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-f564837cb2`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-f564837cb2

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Fedora Update System 2024-11-02 02:24:46 UTC
FEDORA-2024-01763b95cb (ibus-1.5.31~rc1-2.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 9 Fedora Update System 2024-11-16 02:01:23 UTC
FEDORA-2024-f564837cb2 (ibus-1.5.30-7.fc40) has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 10 Paul Bolle 2025-11-11 17:36:17 UTC
TL;DR: I suspect this change possibly left systems with stale /etc/alternatives/xinputrc and /var/lib/alternatives/xinputrc files.

This was done in rawhide with commit da7fce084d2cd6bc6d96bc4a1269245a0e7b6750 ("Resolves #2321990 Move xinit post scripts"). Link: https://src.fedoraproject.org/rpms/ibus/c/da7fce084d2cd6bc6d96bc4a1269245a0e7b6750

But if one has ever upgraded ibus to a release that included that commit _on a system that didn't have ibus-xinit installed_ I think neither /etc/alternatives/xinputrc nor /var/lib/alternatives/xinputrc will ever be removed "automagically".

I need to check the timestamps on those files with what has probably happened to my current setup in the last few years - that system had a pretty wild ride the last few years - but if things match this theory I might reopen this report.

Comment 11 Paul Bolle 2025-11-11 21:30:37 UTC
TL;DR: the timestamps make sense, mostly. But can anyone confirm this situation on their system? You need to have a system upgraded from Fedora 40 or older to run into my issue.

0) The timestamp on /etc/alternatives/xinputrc matches the timestamp of that file in the squashfs.img of the Fedora 38 Workstation Live image. (That is a dangling symlink, because apparently ibux-xinit wasn't shipped by default.) My journey on this system began with Fedora 38. And I don't see why I should have ever installed ibus-xinit.

1) The timestamp on /var/lib/alternatives/xinputrc is a few weeks older than the release of ibus-1.5.30-7.fc40. That is the first Fedora 40 update of ibus shipping the fix for this bug. (It was also the last update to ibus for Fedora 40.) I'm unsure why the timestamp got updated with that update, though.

2) So since I've never uninstalled ibus I never triggered its %postun. And since I've never installed or uninstalled ibus-xinit I never triggered its %postun. Ergo, "alternatives --remove xinputrc" never was run on my system.

3) So it seems the fix for this issue does indeed make stale /etc/alternatives/xinputrc and /var/lib/alternatives/xinputrc files possible. Can anyone confirm?

Comment 12 fujiwara 2025-12-14 05:47:00 UTC
(In reply to Paul Bolle from comment #10)
> TL;DR: I suspect this change possibly left systems with stale
> /etc/alternatives/xinputrc and /var/lib/alternatives/xinputrc files.
> 
> This was done in rawhide with commit
> da7fce084d2cd6bc6d96bc4a1269245a0e7b6750 ("Resolves #2321990 Move xinit post
> scripts"). Link:
> https://src.fedoraproject.org/rpms/ibus/c/
> da7fce084d2cd6bc6d96bc4a1269245a0e7b6750
> 
> But if one has ever upgraded ibus to a release that included that commit _on
> a system that didn't have ibus-xinit installed_ I think neither
> /etc/alternatives/xinputrc nor /var/lib/alternatives/xinputrc will ever be
> removed "automagically".
> 

OK, probably it's good to keep the postrun in both ibus core and ibus xinit for the back compatibility for a while.
It would be good to open a new bug.


Note You need to log in before you can comment on or make changes to this bug.