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