简体   繁体   English

是否有必要使用deconf在debian软件包中获取用户输入

[英]is there any necessity to use deconf to get the user input in debian packages

I am creating a sample debian package, where i need to get the user input which is a number , usually all the user input is taken in postinst script, it would be simple for me if i use simple read command to get what i want, 我正在创建一个示例debian软件包,在这里我需要获取用户输入的数字,通常所有用户输入都是以postinst脚本获取的,如果我使用简单的read命令来获取所需的内容,这对我来说很简单,

Is is mandatory to use debconf like creating templates then config script and using db_get from postinst as in deconf tutorial 使用debconf是强制性的,例如创建模板,配置脚本以及使用postinst中的db_get(deconf教程中所述)

Can any tell me why to use the above complex process instead of using simple read command. 有谁能告诉我为什么要使用上述复杂过程而不是简单的读取命令。

There is no requirement, but debconf does a lot of work for you which you would have to do manually if you don't take advantage of it. 没有要求,但是debconf为您做了很多工作,如果您没有利用它,则必须手动进行。 For example: 例如:

  • You will have to manage the priority of your question manually so that you ask it only if the user has asked to be prompted for information at your question's priority level or greater and supply a default otherwise. 您将必须手动管理问题的优先级,以便仅当系统要求用户提示您输入问题的优先级或更高级别的信息时才询问,否则提供默认值。
  • You will have to figure out if the package is being initially installed, reinstalled, or upgraded, so that you don't, for example, ask your question during an upgrade (the user has presumably already answered it during the installation). 您将必须确定该软件包是最初安装,重新安装还是升级的,例如,在升级过程中您不会提出问题(用户可能已在安装过程中回答了该问题)。
  • You will have to figure out what kind of user interface is available and prompt using readline, curses, or another method, depending on how the system is configured and what is available. 您将必须弄清哪种用户界面可用,并使用readline,curses或其他方法进行提示,具体取决于系统的配置方式和可用的方式。

Are you still sure you want to reject debconf? 您还确定要拒绝debconf吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM