Comment on alternatives removal in preun and RPM scriptlet idiom

- Comment on alternatives removal in preun and RPM scriptlet idiom
- Related: RHEL-68848
This commit is contained in:
Thomas Fitzsimmons 2024-12-13 16:33:26 -05:00
parent 13fc325237
commit 4b8ef12507

View File

@ -533,6 +533,18 @@ fi
exit 0
}
# Perform alternatives removals in preun instead of postun so that we
# are removing live symbolic links instead of dangling symbolic links,
# even though the alternatives command does not seem to care. The
# documentation uses preun or postun without providing a rationale for
# using one over the other:
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Alternatives/
#
# The [ $1 -eq 0 ] is an RPM scriptlet idiom meaning "only do the
# following if this scriptlet is being run during a straight package
# removal; in other words, do NOT do the following if this scriptlet
# is being run as part of an upgrade transaction".
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_syntax
%define preun_headless() %{expand:
if [ "x$debug" == "xtrue" ] ; then
set -x
@ -2389,6 +2401,7 @@ end
- Use compatiblename not name in uniquejavadocdir and uniquesuffix
- Do not overwrite slowdebug __provides_exclude_from and __requires_exclude_from regexps
- Use RPM global macro for man page file extension and unwrap --slave lines
- Comment on alternatives removal in preun and RPM scriptlet idiom
- Resolves: RHEL-71920
- Resolves: RHEL-71954
- Resolves: RHEL-69321