3
0

- Drop support for -n/-f options in %service_del_postun

These options have been deprecated since a long time and the last package
  relying on them (drkonqi5) in the Factory repository has been updated.

OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=84
This commit is contained in:
Franck Bui 2023-03-29 10:42:15 +00:00 committed by Git OBS Bridge
parent a8a48f191f
commit 3d2aa53763
2 changed files with 16 additions and 21 deletions

View File

@ -66,20 +66,6 @@ OrderWithRequires(postun): systemd \
Suggests: systemd \ Suggests: systemd \
%{nil} %{nil}
%_restart_on_update_force() /usr/bin/systemctl try-restart %{*} || : %{nil}
%_restart_on_update_never() : # Restart of %{*} skipped %{nil}
%_restart_on_update() \
if [ -e /etc/sysconfig/services ]; then \
DISABLE_RESTART_ON_UPDATE= \
. /etc/sysconfig/services \
case "$DISABLE_RESTART_ON_UPDATE" in \
yes|1) ;; \
*) /usr/bin/systemctl try-restart %{*} || : \
esac \
fi \
%{nil}
# Figure out when presets need to be applied. This information is only # Figure out when presets need to be applied. This information is only
# recorded during %pre and is actually applied during %post. # recorded during %pre and is actually applied during %post.
# #
@ -150,18 +136,19 @@ fi \
# On uninstall, tell systemd to reload its unit files # On uninstall, tell systemd to reload its unit files
# #
# Deprecated options, please do not use in new code:
# -f : force restart on update (replaced by %service_del_postun_with_restart)
# -n : don't restart on update (replaced by %service_del_postun_without_restart)
#
# The default is to read DISABLE_RESTART_ON_UPDATE from /etc/sysconfig/services # The default is to read DISABLE_RESTART_ON_UPDATE from /etc/sysconfig/services
# #
%service_del_postun(fn) \ %service_del_postun() \
if [ -x /usr/bin/systemctl ]; then \ if [ -x /usr/bin/systemctl ]; then \
/usr/bin/systemctl daemon-reload || : \ /usr/bin/systemctl daemon-reload || : \
if [ $1 -ge 1 ]; then \ if [ $1 -ge 1 ] && [ -e /etc/sysconfig/services ]; then \
# Package upgrade, not uninstall \ # Package upgrade, not uninstall \
%{expand:%%_restart_on_update%{-f:_force}%{!-f:%{-n:_never}} %{?*}} \ DISABLE_RESTART_ON_UPDATE= \
. /etc/sysconfig/services \
case "$DISABLE_RESTART_ON_UPDATE" in \
yes|1) ;; \
*) /usr/bin/systemctl try-restart %{*} || : \
esac \
fi \ fi \
fi \ fi \
%{nil} %{nil}

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Wed Mar 29 10:40:14 UTC 2023 - Franck Bui <fbui@suse.com>
- Drop support for -n/-f options in %service_del_postun
These options have been deprecated since a long time and the last package
relying on them (drkonqi5) in the Factory repository has been updated.
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Jan 26 14:12:28 UTC 2023 - Franck Bui <fbui@suse.com> Thu Jan 26 14:12:28 UTC 2023 - Franck Bui <fbui@suse.com>