我是RPM大楼中的一名newby。我必须构建RPM,只有在目标机器上存在文件/ etc/i-am-a-require时才会安装软件包。所以我写了如何在SPEC文件脚本的%pre部分返回false时回滚RPM安装
%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-要求”分布二进制,所以它不会有一个包在所有。
http://stackoverflow.com/questions/9932562/how-to-exit-rpm-install-in-case-of-an-error?rq = 1 –