在规范步骤中以编程方式安装 RPM 失败
我正在制定 RPM。这个特定的 RPM 具有无法表示为 RPM 先决条件的要求,我们将它们称为特定的文件系统/磁盘配置。目前,当不满足要求时,安装后、运行时会发生故障。
我可以在脚本的 %install, 部分检查所需的先决条件。但是,如果满足某些条件,我无法弄清楚如何使安装失败。是否有可能通过 %install(或其他)部分中的某些触发器在运行时使 rpm 安装失败?
.spec 文件中的示例如下所示:
%install
if [ -f /some/file ]
then
FAIL_RPM_INSTALL ## What is this command?
fi
I'm making an RPM. This particular RPM has requirements that can't be expressed as RPM prerequisites, lets call them a particular filesystem/disk configuration. Currently the failure happens after install, at runtime, when the requirements aren't met.
I can check for the required prerequisites in the %install, section of my script. However, I can't figure out how to fail the install if certain criteria are met. Is it possible to fail an rpm install at runtime via some trigger in the %install (or some other) section?
An example would look something like so, in a .spec file:
%install
if [ -f /some/file ]
then
FAIL_RPM_INSTALL ## What is this command?
fi
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
事实证明,如果您在
%pre
阶段退出,rpm 安装将会失败。参考:https://fedoraproject.org/wiki/Packaging:ScriptletSnippets
It turns out that if you exit in the
%pre
stage the rpm install will fail.Reference: https://fedoraproject.org/wiki/Packaging:ScriptletSnippets