RPM - 安装时间参数 [英] RPM - Install time parameters

查看:150
本文介绍了RPM - 安装时间参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我打包我的应用程序到一个RPM包,比方说, myapp.rpm 。虽然安装此应用程序,我想从用户(输入可以是一个例子 - 当应用程序是越来越安装环境 - 开发,质量保证,UAT,督促)收到一些投入。基于输入,应用程序将安装适当的文件。有没有一种方法来传递参数,而安装应用程序?

I have packaged my application into an RPM package, say, myapp.rpm. While installing this application, I would like to receive some inputs from the user (an example for input could be - environment where the app is getting installed - "dev", "qa", "uat", "prod"). Based on the input, the application will install the appropriate files. Is there a way to pass parameters while installing the application?

P.S。:一种可能的解决办法是创建一个RPM包的每个环境。然而,在我们的方案中,这不是一个可行的选择,因为我们有大约20个环境,我们不希望有20个不同的包相同的应用程序。

P.S.: A possible solution could be to create an RPM package for each environment. However, in our scenario, this is not a viable option since we have around 20 environments and we do not wish to have 20 different packages for the same application.

推荐答案

在一般情况下,RPM包不应该要求用户交互。一次又一次,RPM的人都表示,这是RPM的一个明确设计目标不具有交互安装。对于需要某种输入第一次使用前包,则通常要求在第一次使用这些信息,我们的你把它所有的配置文件与宏或东西,告诉你的用户,他们将不得不配置的应用程序之前,它是可用

In general, RPM packages should not require user interaction. Time and time again, the RPM folks have stated that it is an explicit design goal of RPM to not have interactive installs. For packages that need some sort of input before first use, you typically ask for this information on first use, our you put it all in config files with macros or something and tell your users that they will have to configure the application before it is usable.

即使通过某种计算为最终用户交互的参数。我想你想要的是让你的pre或安装脚本自动检测环境弄好了,也许通过具有文件的地方,他们可以检查。我也会从RPM用户的角度出发,指出,有一个名为* -qa.rpm包是很多不是通过一些随机参数,更加直观。

Even passing a parameter of some sort counts as end-user interaction. I think what you want is to have your pre or install scripts auto detect the environment somehow, maybe by having a file somewhere they can examine. I'll also point out that from an RPM user's perspective, having a package named *-qa.rpm is a lot more intuitive than passing some random parameter.

有关您的具体问题,如果你正在安装不同的内容,您创建不同的包。如果您尝试不同的事情,你要结束了战斗RPM的系统越来越多。

For your exact problem, if you are installing different content, you should create different packages. If you try to do things differently, you're going to end up fighting the RPM system more and more.

这是不难创建构建系统,可以吐出20多包的都大多是相似的。我曾与一个模板上下的规范文件,并做出将创建不同的规范文件并构建RPMS运行一些脚本做了。如果不知道具体情况,这听起来像你甚至可能有一个核心包,所有的20+环境软件包依赖于,那么环境特定的软件包安装任何专门针对他们的目标环境。

It isn't hard to create a build system that can spit out 20+ packages that are all mostly similar. I've done it with a template-ish spec file and some scripts run by make that will create the various spec files and build the RPMS. Without knowing the specifics, it sounds like you might even have a core package that all 20+ environment packages depend on, then the environment specific packages install whatever is specific to their target environment.

这篇关于RPM - 安装时间参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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