From 4b8ef125072bef137a851e4b746a4bf7d16d039c Mon Sep 17 00:00:00 2001 From: Thomas Fitzsimmons Date: Fri, 13 Dec 2024 16:33:26 -0500 Subject: [PATCH] Comment on alternatives removal in preun and RPM scriptlet idiom - Comment on alternatives removal in preun and RPM scriptlet idiom - Related: RHEL-68848 --- java-21-openjdk.spec | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/java-21-openjdk.spec b/java-21-openjdk.spec index ba37b4c..f06a024 100644 --- a/java-21-openjdk.spec +++ b/java-21-openjdk.spec @@ -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