Skip to content

weak-modules2: don't remove symlinks in the rpm --reinstall case#126

Open
mwilck wants to merge 1 commit intomasterfrom
bsc1257055
Open

weak-modules2: don't remove symlinks in the rpm --reinstall case#126
mwilck wants to merge 1 commit intomasterfrom
bsc1257055

Conversation

@mwilck
Copy link
Contributor

@mwilck mwilck commented Feb 4, 2026

If a KMP is reinstalled with "rpm -i --reinstall", weak-updates symlinks will be missing because %postun is called after %post. It will think that this KMP is being removed, and delete symlinks pointing to modules from the KMP in question.

To avoid that, check in %postun if the number of remaining packages is 1. This can be the update or reinstall case. To distinguish the two, check if another KMP with the same name, but different version/release is installed. If yes, it's an update; otherwise, it makes sense to assume that it's a reinstall and that we shouldn't delete the symlinks.

If a KMP is reinstalled with "rpm -i --reinstall", weak-updates symlinks
will be missing because %postun is called after %post. It will think
that this KMP is being removed, and delete symlinks pointing to modules
from the KMP in question.

To avoid that, check in %postun if the number of remaining packages is 1.
This can be the update or reinstall case. To distinguish the two, check
if another KMP with the same name, but different version/release is
installed. If yes, it's an update; otherwise, it makes sense to assume
that it's a reinstall and that we shouldn't delete the symlinks.

Signed-off-by: Martin Wilck <mwilck@suse.com>
@mwilck mwilck requested a review from hramrach February 4, 2026 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant