1

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,

Is is mandatory to use debconf like creating templates then config script and using db_get from postinst as in deconf tutorial

Can any tell me why to use the above complex process instead of using simple read command.

the paul
  • 8,972
  • 1
  • 36
  • 53
forum.test17
  • 2,119
  • 6
  • 30
  • 62

1 Answers1

1

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. 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.

Are you still sure you want to reject debconf?

Celada
  • 21,627
  • 4
  • 64
  • 78
  • thanks for the reply, but since morning i am unable to get my simple test debian package to work with debconf, – forum.test17 Jun 01 '12 at 16:16
  • do you have any other simple tutorial other than this http://www.fifi.org/doc/debconf-doc/tutorial.html – forum.test17 Jun 01 '12 at 17:19
  • No, sorry. It's been a while since I've made a package that needed to ask a question. – Celada Jun 01 '12 at 20:15
  • 1
    Just as a small correction: there actually *is* a requirement to use debconf or something conforming to the same specification when prompting the user, in Debian Policy: http://www.debian.org/doc/debian-policy/ch-binary.html#s-maintscriptprompt . There are *a lot* of different situations under which packages get installed/uninstalled/reinstalled/reconfigured, and it makes life lots simpler for your users if they can expect your package to behave in an expected way. – the paul Jun 05 '12 at 19:11
  • If you have a specific problem with debconf, you might post that here and see if you can have better luck getting help with it. – the paul Jun 05 '12 at 19:11