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