Move postun alternatives logic to preun

- Move postun alternatives logic to preun
- Related: RHEL-68848
This commit is contained in:
Thomas Fitzsimmons 2024-09-24 18:46:03 -04:00
parent adf8faf24f
commit 86b20e17d5

View File

@ -564,7 +564,7 @@ exit 0
} }
%define postun_headless() %{expand: %define preun_headless() %{expand:
if [ "x$debug" == "xtrue" ] ; then if [ "x$debug" == "xtrue" ] ; then
set -x set -x
fi fi
@ -681,7 +681,7 @@ update-desktop-database %{_datadir}/applications &> /dev/null || :
exit 0 exit 0
} }
%define postun_devel() %{expand: %define preun_devel() %{expand:
if [ "x$debug" == "xtrue" ] ; then if [ "x$debug" == "xtrue" ] ; then
set -x set -x
fi fi
@ -692,7 +692,12 @@ then
alternatives --remove java_sdk_%{javaver} %{_jvmdir}/%{sdkdir -- %{?1}} alternatives --remove java_sdk_%{javaver} %{_jvmdir}/%{sdkdir -- %{?1}}
alternatives --remove java_sdk_%{javaver}_%{origin} %{_jvmdir}/%{sdkdir -- %{?1}} alternatives --remove java_sdk_%{javaver}_%{origin} %{_jvmdir}/%{sdkdir -- %{?1}}
fi fi
}
%define postun_devel() %{expand:
if [ "x$debug" == "xtrue" ] ; then
set -x
fi
update-desktop-database %{_datadir}/applications &> /dev/null || : update-desktop-database %{_datadir}/applications &> /dev/null || :
if [ $1 -eq 0 ] ; then if [ $1 -eq 0 ] ; then
@ -731,7 +736,7 @@ fi
exit 0 exit 0
} }
%define postun_javadoc() %{expand: %define preun_javadoc() %{expand:
if [ "x$debug" == "xtrue" ] ; then if [ "x$debug" == "xtrue" ] ; then
set -x set -x
fi fi
@ -770,7 +775,7 @@ fi
exit 0 exit 0
} }
%define postun_javadoc_zip() %{expand: %define preun_javadoc_zip() %{expand:
if [ "x$debug" == "xtrue" ] ; then if [ "x$debug" == "xtrue" ] ; then
set -x set -x
fi fi
@ -2255,8 +2260,8 @@ done
%postun %postun
%{postun_script %{nil}} %{postun_script %{nil}}
%postun headless %preun headless
%{postun_headless %{nil}} %{preun_headless %{nil}}
%posttrans %posttrans
%{posttrans_script %{nil}} %{posttrans_script %{nil}}
@ -2267,6 +2272,9 @@ done
%post devel %post devel
%{post_devel %{nil}} %{post_devel %{nil}}
%preun devel
%{preun_devel %{nil}}
%postun devel %postun devel
%{postun_devel %{nil}} %{postun_devel %{nil}}
@ -2276,14 +2284,14 @@ done
%posttrans javadoc %posttrans javadoc
%{alternatives_javadoc_install %{nil}} %{alternatives_javadoc_install %{nil}}
%postun javadoc %preun javadoc
%{postun_javadoc %{nil}} %{preun_javadoc %{nil}}
%posttrans javadoc-zip %posttrans javadoc-zip
%{alternatives_javadoczip_install %{nil}} %{alternatives_javadoczip_install %{nil}}
%postun javadoc-zip %preun javadoc-zip
%{postun_javadoc_zip %{nil}} %{preun_javadoc_zip %{nil}}
%endif %endif
%if %{include_debug_build} %if %{include_debug_build}
@ -2299,8 +2307,8 @@ done
%postun slowdebug %postun slowdebug
%{postun_script -- %{debug_suffix_unquoted}} %{postun_script -- %{debug_suffix_unquoted}}
%postun headless-slowdebug %preun headless-slowdebug
%{postun_headless -- %{debug_suffix_unquoted}} %{preun_headless -- %{debug_suffix_unquoted}}
%posttrans slowdebug %posttrans slowdebug
%{posttrans_script -- %{debug_suffix_unquoted}} %{posttrans_script -- %{debug_suffix_unquoted}}
@ -2308,6 +2316,9 @@ done
%post devel-slowdebug %post devel-slowdebug
%{post_devel -- %{debug_suffix_unquoted}} %{post_devel -- %{debug_suffix_unquoted}}
%preun devel-slowdebug
%{preun_devel -- %{debug_suffix_unquoted}}
%postun devel-slowdebug %postun devel-slowdebug
%{postun_devel -- %{debug_suffix_unquoted}} %{postun_devel -- %{debug_suffix_unquoted}}
@ -2325,8 +2336,8 @@ done
%postun fastdebug %postun fastdebug
%{postun_script -- %{fastdebug_suffix_unquoted}} %{postun_script -- %{fastdebug_suffix_unquoted}}
%postun headless-fastdebug %preun headless-fastdebug
%{postun_headless -- %{fastdebug_suffix_unquoted}} %{preun_headless -- %{fastdebug_suffix_unquoted}}
%posttrans fastdebug %posttrans fastdebug
%{posttrans_script -- %{fastdebug_suffix_unquoted}} %{posttrans_script -- %{fastdebug_suffix_unquoted}}
@ -2337,6 +2348,9 @@ done
%post devel-fastdebug %post devel-fastdebug
%{post_devel -- %{fastdebug_suffix_unquoted}} %{post_devel -- %{fastdebug_suffix_unquoted}}
%preun devel-fastdebug
%{preun_devel -- %{fastdebug_suffix_unquoted}}
%postun devel-fastdebug %postun devel-fastdebug
%{postun_devel -- %{fastdebug_suffix_unquoted}} %{postun_devel -- %{fastdebug_suffix_unquoted}}
@ -2443,6 +2457,7 @@ done
- Set rpmrelease to 4 - Set rpmrelease to 4
- Remove copy-jdk-configs logic - Remove copy-jdk-configs logic
- Remove alternatives removal special handling - Remove alternatives removal special handling
- Move postun alternatives logic to preun
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 1:21.0.5.0.11-2.1 * Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 1:21.0.5.0.11-2.1
- Bump release for October 2024 mass rebuild: - Bump release for October 2024 mass rebuild: