Bug 980387 - Requires(post,postun) can hinder uninstalls
Summary: Requires(post,postun) can hinder uninstalls
Status: NEW
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Current
Hardware: All Linux
: P5 - None : Enhancement (vote)
Target Milestone: ---
Assignee: Jan Engelhardt
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-17 15:59 UTC by Jan Engelhardt
Modified: 2016-05-17 16:28 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Engelhardt 2016-05-17 15:59:32 UTC
The presence of Requires(preun) and Requires(postun) tags in specfiles mean that, to uninstall a package X, the presence of another provider Y is required - at uninstall time. If Y is not installed during normal system operation, then Y needs to be installed to permit X's removal, which feels backwards to the idea of getting rid of packages.

17:52 < DimStar:#opensuse-factory> there seems also to be a bug in rpm imho: rpm -qR colord | grep systemd => it is listed 4 times... which are the 4 scripts (pre,post,preun,postun).. - all of them stopping an uninstall

Indeed, `rpm -e` will error out. `zypper rm`, by its solver nature, will just performing the installation of Y together with the removal of X in one go, though without removing Y afterwards again.

Suggestion is therefore to remove all preun/postun requires and make the %preun and %postun scripts deal with absence of programs.
Comment 1 Dominique Leuenberger 2016-05-17 16:04:32 UTC
For reference:

this discussion came up out of a simple usecase of producing a 'docker image with apache2', where

apache2 has the usual %systemd_requires and service handling in post/postun

The presence of systemd in such a container is rather useless - but it can't be removed for the dependencies of the scriptlets
Comment 2 Jan Engelhardt 2016-05-17 16:28:30 UTC
For %systemd_requires, there is now bug #980389.

This ticket is solely about Requires(preun,postun) specifically. On the matter, the first package with scriptlets that comes to mind is shared-mime-info together with %post /usr/bin/update-mime-database. In a number of places, such as o:F/boo, this has already been protected with [ -x /usr/bin/update-mime-database ].