如何在 rpmbuild 规范文件中检查操作系统版本 [英] How to check os version in rpmbuild spec file

查看:49
本文介绍了如何在 rpmbuild 规范文件中检查操作系统版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个需要检查操作系统版本的 rpm.如果它是rhel5 或rhel6,那么它会工作,否则它会停止.请建议我怎么做.

I am building an rpm where I need to check the OS version. If it is rhel5 or rhel6, then it'll work, else it'll stop. Please advice how can I make it.

谢谢&问候.

推荐答案

另一个替代方案 用于使用 uname 命令和解析信息

Another alternate Use to use the uname command and parse Information

节省时间执行以下操作:

Save time execute the following:

uname -r | cut -d '.' -f6

这在 RHEL 6 和 7 中有效.

This is valid in RHEL 6 and 7.

这篇关于如何在 rpmbuild 规范文件中检查操作系统版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆