richardphibel / rpms / systemd

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