From 7b2e3f4d22c8eedfdfafdcc9686033df3525911b64a6cbe584a18b1643fb22ea Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Wed, 27 Feb 2019 14:16:36 +0000 Subject: [PATCH] - 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 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=35 --- macros.systemd | 8 ++++++-- systemd-rpm-macros.changes | 13 +++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) 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