fedora - 在规范步骤中以编程方式安装 RPM 失败

标签 fedora rpm

我正在制定 RPM。这个特定的 RPM 具有无法表示为 RPM 先决条件的要求,我们将它们称为特定的文件系统/磁盘配置。目前,当不满足要求时,安装后、运行时会发生故障。

我可以在脚本的 %install, 部分检查所需的先决条件。但是,如果满足某些条件,我无法弄清楚如何使安装失败。是否有可能通过 %install(或其他)部分中的某些触发器在运行时使 rpm 安装失败?

.spec 文件中的示例如下所示:

%install
if [ -f /some/file ]
then
    FAIL_RPM_INSTALL ## What is this command?
fi

最佳答案

事实证明,如果您在 %pre 阶段退出,rpm 安装将会失败。

%pre
if [ -f /some/file ]
then
    echo "/some/file exists, it shouldn't"
    exit 1
fi

引用:https://fedoraproject.org/wiki/Packaging:ScriptletSnippets

关于fedora - 在规范步骤中以编程方式安装 RPM 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4037410/

相关文章:

javascript - 无法使 Node.js hello world 应用程序运行 [Fedora 21]

linux - RPM 包中的几个组

linux - 使用 rpmbuild 在 "/"下创建 var 文件

linux - 删除有关 centos 问题的包

rpm - 使用 venv 和 rpm 在内部部署 python 应用程序

Fedora/NVIDIA GPU 上的 Android Emulator 黑屏

fedora - Gnome 3 在 Dock 中显示同一个应用程序的两个图标

c++ - cstdlib 无法使用::wcstombs 解析

linux - 如何继续安装Fedora 18 KDE Spin 32位

c++ - AIX 上的 std::locale::operator=(std::locale const&) 崩溃