forked from pool/systemd-rpm-macros
- Test for the presence of systemd only once in %service_add_post
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=45
This commit is contained in:
parent
b8ac3768b4
commit
664f945153
@ -85,26 +85,18 @@ fi \
|
|||||||
# On install, tell systemd to reload its unit files
|
# On install, tell systemd to reload its unit files
|
||||||
%service_add_post() \
|
%service_add_post() \
|
||||||
if [ -x /usr/bin/systemctl ]; then \
|
if [ -x /usr/bin/systemctl ]; then \
|
||||||
|
# FIXME: why is this needed ? \
|
||||||
/usr/bin/systemctl daemon-reload || : \
|
/usr/bin/systemctl daemon-reload || : \
|
||||||
fi \
|
|
||||||
\
|
\
|
||||||
if [ $1 -eq 1 ]; then \
|
if [ $1 -eq 1 ]; then \
|
||||||
if [ -x /usr/bin/systemctl ]; then \
|
|
||||||
/usr/bin/systemctl preset %{?*} || : \
|
/usr/bin/systemctl preset %{?*} || : \
|
||||||
fi \
|
else \
|
||||||
elif [ $1 -gt 1 ]; then \
|
for service in %{?*} ; do \
|
||||||
for service in %{?*} ; do \
|
if [ -e "/run/rpm-%{name}-update-$service-new-in-upgrade" ]; then \
|
||||||
if [ ! -e "/run/rpm-%{name}-update-$service-new-in-upgrade" ]; then \
|
rm -f "/run/rpm-%{name}-update-$service-new-in-upgrade" \
|
||||||
continue \
|
/usr/bin/systemctl preset "$service" || : \
|
||||||
fi \
|
fi \
|
||||||
rm -f "/run/rpm-%{name}-update-$service-new-in-upgrade" \
|
done \
|
||||||
if [ ! -x /usr/bin/systemctl ]; then \
|
|
||||||
continue \
|
|
||||||
fi \
|
|
||||||
/usr/bin/systemctl preset "$service" || : \
|
|
||||||
done \
|
|
||||||
\
|
|
||||||
if [ -x /usr/lib/systemd/systemd-sysv-convert ]; then \
|
|
||||||
/usr/lib/systemd/systemd-sysv-convert --apply %{?*} || : \
|
/usr/lib/systemd/systemd-sysv-convert --apply %{?*} || : \
|
||||||
fi \
|
fi \
|
||||||
fi \
|
fi \
|
||||||
@ -141,11 +133,9 @@ fi \
|
|||||||
#
|
#
|
||||||
%service_del_postun(fn) \
|
%service_del_postun(fn) \
|
||||||
%service_del_postun_without_restart %{?*} \
|
%service_del_postun_without_restart %{?*} \
|
||||||
if [ $1 -ge 1 ]; then \
|
if [ $1 -ge 1 -a -x /usr/bin/systemctl ]; then \
|
||||||
# Package upgrade, not uninstall \
|
# Package upgrade, not uninstall \
|
||||||
if [ -x /usr/bin/systemctl ]; then \
|
%{expand:%%_restart_on_update%{-f:_force}%{!-f:%{-n:_never}} %{?*}} \
|
||||||
%{expand:%%_restart_on_update%{-f:_force}%{!-f:%{-n:_never}} %{?*}} \
|
|
||||||
fi \
|
|
||||||
fi \
|
fi \
|
||||||
%{nil}
|
%{nil}
|
||||||
|
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Nov 9 07:58:01 UTC 2020 - Franck Bui <fbui@suse.com>
|
||||||
|
|
||||||
|
- Test for the presence of systemd only once in %service_add_post
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Nov 9 07:44:40 UTC 2020 - Franck Bui <fbui@suse.com>
|
Mon Nov 9 07:44:40 UTC 2020 - Franck Bui <fbui@suse.com>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user