如何定义空体的 rpm 规格宏?

发布于 2024-09-14 08:03:50 字数 351 浏览 4 评论 0原文

问题很容易表现出来:

rpm --eval "%define xyz"
error: Macro %xyz has empty body

我想获取 patch_level 并且 echo_dist 可能返回 sles11 或 sles11sp1,对于 sle1s11 我只希望 patch_level 为空字符串,但这会导致空主体错误。

rpm --eval "%{expand: %%define patch_level %(echo_dist | sed -e "s/sles11//")}

我不完全理解 rpm 规范文件,对这个问题有什么建议吗?

the problem is quite easy to exhibit:

rpm --eval "%define xyz"
error: Macro %xyz has empty body

i want to get the patch_level and echo_dist may return sles11 or sles11sp1, for sle1s11 i just want the patch_level to be an empty string, but that leads to the empty body error.

rpm --eval "%{expand: %%define patch_level %(echo_dist | sed -e "s/sles11//")}

i am not fully understand the rpm spec file, any suggestion to the problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

纵性 2024-09-21 08:03:50

这可能就是您正在寻找的:

%define xyz %{nil}

This might be what you are looking for:

%define xyz %{nil}
十二 2024-09-21 08:03:50

尝试

%define xyz %100

将宏的参数扩展为 100,该宏将为空。

Try

%define xyz %100

supposed to expand to the 100's parameter to the macro which will be empty.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文