6
0

Accepting request 1075207 from Base:System

- Bump to version 20

- %service_del_postun: make sure to restart services if /etc/sysconfig/service
  is not present.

- 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/request/show/1075207
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd-rpm-macros?expand=0&rev=44
This commit is contained in:
2023-04-03 15:45:18 +00:00
committed by Git OBS Bridge
3 changed files with 33 additions and 25 deletions

View File

@@ -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.
#
@@ -148,20 +134,23 @@ if [ -x /usr/bin/systemctl ]; then \
fi \
%{nil}
# On uninstall, tell systemd to reload its unit files
# On uninstall, tell systemd to reload its unit files.
# On update, tell systemd to reload and restart service unless
# DISABLE_RESTART_ON_UPDATE from /etc/sysconfig/services says otherwise
#
# 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 \
# Package upgrade, not uninstall \
%{expand:%%_restart_on_update%{-f:_force}%{!-f:%{-n:_never}} %{?*}} \
DISABLE_RESTART_ON_UPDATE=no \
[ -e /etc/sysconfig/services ] && . /etc/sysconfig/services || : \
\
case "$DISABLE_RESTART_ON_UPDATE" in \
yes|1) ;; \
*) /usr/bin/systemctl try-restart %{*} || : \
esac \
fi \
fi \
%{nil}
@@ -174,7 +163,7 @@ fi \
%systemd_post() %{expand::%%service_add_post %{?**}}
%systemd_preun() %{expand::%%service_del_preun %{?**}}
%systemd_postun() %{expand::%%service_del_postun_without_restart %{?**}}
%systemd_postun_with_restart() %{expand::%%service_del_postun %{?**}}
%systemd_postun_with_restart() %{expand::%%service_del_postun_with_restart %{?**}}
%systemd_user_pre() \
if [ -x /usr/bin/systemctl ]; then \

View File

@@ -1,3 +1,22 @@
-------------------------------------------------------------------
Wed Mar 29 11:38:07 UTC 2023 - Franck Bui <fbui@suse.com>
- Bump to version 20
-------------------------------------------------------------------
Wed Mar 29 11:33:44 UTC 2023 - Franck Bui <fbui@suse.com>
- %service_del_postun: make sure to restart services if /etc/sysconfig/service
is not present.
-------------------------------------------------------------------
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>

View File

@@ -17,7 +17,7 @@
Name: systemd-rpm-macros
Version: 19
Version: 20
Release: 0
Summary: RPM macros for systemd
License: LGPL-2.1-or-later