From 3d2aa53763c80bbe0821c542a599863d640bafad0a9c3250eb58bc22a7e4016f Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Wed, 29 Mar 2023 10:42:15 +0000 Subject: [PATCH] - 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 --- macros.systemd | 29 ++++++++--------------------- systemd-rpm-macros.changes | 8 ++++++++ 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/macros.systemd b/macros.systemd index e08e745..396dbfb 100644 --- a/macros.systemd +++ b/macros.systemd @@ -66,20 +66,6 @@ OrderWithRequires(postun): systemd \ Suggests: systemd \ %{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 # recorded during %pre and is actually applied during %post. # @@ -150,18 +136,19 @@ fi \ # 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 # -%service_del_postun(fn) \ +%service_del_postun() \ if [ -x /usr/bin/systemctl ]; then \ /usr/bin/systemctl daemon-reload || : \ - if [ $1 -ge 1 ]; then \ + if [ $1 -ge 1 ] && [ -e /etc/sysconfig/services ]; then \ # 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 \ %{nil} diff --git a/systemd-rpm-macros.changes b/systemd-rpm-macros.changes index 5db9458..1a9ac0b 100644 --- a/systemd-rpm-macros.changes +++ b/systemd-rpm-macros.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Mar 29 10:40:14 UTC 2023 - Franck Bui + +- 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