diff --git a/macros.systemd b/macros.systemd index f59bf64..41cdf4c 100644 --- a/macros.systemd +++ b/macros.systemd @@ -54,7 +54,9 @@ OrderWithRequires(postun): systemd \ %_restart_on_update_force() (\ %{?*:/usr/bin/systemctl try-restart %{*}} \ ) || : %{nil} -%_restart_on_update_never() %{?*:# Restart of %{*} skipped} %{nil} + +%_restart_on_update_never() %{?*: : # Restart of %{*} skipped} %{nil} + %_restart_on_update() (\ test -f /etc/sysconfig/services -a \\\ -z "$DISABLE_RESTART_ON_UPDATE" && . /etc/sysconfig/services\ @@ -66,7 +68,9 @@ OrderWithRequires(postun): systemd \ %_stop_on_removal_force() ( \ %{?*:/usr/bin/systemctl stop %{*}}\ ) || : %{nil} -%_stop_on_removal_never() %{?*:# Stop of %{*} skipped} %{nil} + +%_stop_on_removal_never() %{?*: : # Stop of %{*} skipped} %{nil} + %_stop_on_removal() (\ test -f /etc/sysconfig/services -a \\\ -z "$DISABLE_STOP_ON_REMOVAL" && . /etc/sysconfig/services\ diff --git a/systemd-rpm-macros.changes b/systemd-rpm-macros.changes index a53f6a7..8e1bd71 100644 --- a/systemd-rpm-macros.changes +++ b/systemd-rpm-macros.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Wed Feb 27 14:13:28 UTC 2019 - Franck Bui + +- Make sure %_restart_on_update_never and %_stop_on_removal_never + don't expand to the empty string + + Otherwise sequences like the following would result in incorrect + shell syntax: + + if [ ]; then + %_restart_on_update_never + fi + ------------------------------------------------------------------- Wed Feb 27 12:17:18 UTC 2019 - Franck Bui