Blame SOURCES/0653-rpm-fix-systemd_user_post-macro.patch

17b0f1
From dda4324fa0b1fb1e07dea18585df6962d8f34b0f Mon Sep 17 00:00:00 2001
17b0f1
From: =?UTF-8?q?Tadej=20Jane=C5=BE?= <tadej.j@nez.si>
17b0f1
Date: Sun, 22 Nov 2015 20:38:05 +0100
17b0f1
Subject: [PATCH] rpm: fix %systemd_user_post() macro.
17b0f1
MIME-Version: 1.0
17b0f1
Content-Type: text/plain; charset=UTF-8
17b0f1
Content-Transfer-Encoding: 8bit
17b0f1
17b0f1
Escape "--user" and "--global" arguments with "\\" since rpm treats
17b0f1
arguments starting with "-" as macro options which causes "Unknown
17b0f1
option" rpm error.
17b0f1
Use %{expand:...} to force expansion of the inner macro. Otherwise %{?*}
17b0f1
is recursively defined as "\--user \--global {%?*}" which causes
17b0f1
"Too many levels of recursion in macro expansion" rpm error.
17b0f1
17b0f1
Thanks to Michael Mráka for helping me fix the above issues.
17b0f1
17b0f1
(cherry picked from commit e67ba783696f21782ad5c2ba00515d387016e785)
17b0f1
Related: #1582383
17b0f1
---
17b0f1
 src/core/macros.systemd.in | 2 +-
17b0f1
 1 file changed, 1 insertion(+), 1 deletion(-)
17b0f1
17b0f1
diff --git a/src/core/macros.systemd.in b/src/core/macros.systemd.in
17b0f1
index bea6ef1da3..662791cccc 100644
17b0f1
--- a/src/core/macros.systemd.in
17b0f1
+++ b/src/core/macros.systemd.in
17b0f1
@@ -43,7 +43,7 @@ if [ $1 -eq 1 ] ; then \
17b0f1
 fi \
17b0f1
 %{nil}
17b0f1
 
17b0f1
-%systemd_user_post() %systemd_post --user --global %{?*}
17b0f1
+%systemd_user_post() %{expand:%systemd_post \\--user \\--global %%{?*}}
17b0f1
 
17b0f1
 %systemd_preun() \
17b0f1
 if [ $1 -eq 0 ] ; then \