【发布时间】:2016-08-05 20:35:19
【问题描述】:
我是 RPM 构建的新手。我必须构建 RPM,仅当目标机器上存在文件 /etc/i-am-a-requirement 时才会安装包。所以我写了
%pre
if test -f "/etc/i-am-a-requirement"; then
echo "I'm OK to continue"
else
echo "The file is not found, the RPM won't be installed"
-- How to add failure here? --
fi
我知道通常我们希望 RPM 有依赖包,但在这种情况下,“/etc/i-am-a-requirement”是作为二进制分发的,所以它根本没有包。
【问题讨论】: