[英]How to execute button.setOnTouchListener when some conditions are met (Kotlin)
[英]How to abort the installation of an rpm package if some conditions are not met in specfile?
Requires
标签还不能满足其他要求。 所以我写了一个脚本来验证这些东西,但是我应该放在哪里呢? 如果未找到,那么我想退出安装,提示用户在尝试再次安装此rpm之前先执行步骤。
在%install
标记中写入exit 1
无法使用rpmbuild构建rpm。 说%install has a bad exit code.
编辑:让我为您提供一个示例。 我最初想要测试的是是否存在Oracle Java 6。 如果没有,请提供指向Java6的路径。 如果用户无法提供...,请退出RPM。 如果没有Java,则不允许使用高级Java,并且安装不会成功。 如果用户不想安装Java rpm软件包,则无法将其放置在“要求”中。
希望我能理解我的意思。
您可以将%pre节用于此类任务。
%pre脚本在即将安装软件包之前执行。 它是罕见的软件包,在安装之前需要完成任何操作。 构成Red Hat Linux Linux 4.0的350个软件包中没有一个使用它。
一些入门指南; 脚本内容(未在%pre部分中使用)来自jpackage-utils,您将在此找到一些其他好的脚本示例:
%pre
# try to find jvm from java command
# try javac first, or we might get the location of the jre instead - djw
java=`which javac 2>/dev/null || :`
# if we don't have the jdk, then maybe we have the jre - djw
if [ -z "$java" ] ; then
java=`which java 2>/dev/null || :`
fi
if [ -n "$java" ] ; then
while [ -h "$java" ] ; do
java=`readlink $java 2>/dev/null`
done
return
fi
echo "Can't find java virtual machine, aborting."
exit 1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.