[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Common set of debconf templates



Quoting Marc Haber (mh+debian-devel@zugschlus.de):

> Do we have infrastructure to handle different answers for the same
> question? Maybe I'd like to have a different dbadmin password on my
> postgresql database than on mysql?


Yes, we have it through the REGISTER command in the debconf protocol
(see man debconf-devel)where you can create several independent
questions from the same template.

quote from debcond-devel(7):

QUESTIONS
       A question is an instantiated template. By asking debconf to
       display a question, your config script can interact with the
       user. When debconf loads a templates file (this happens
       whenever a config or postinst script is run), it automatically
       instantiates a question from each template. It is actually
       possible to instantiate several independent questions from the
       same template (using the REGISTER com- mand), but that is
       rarely necessary. Templates are static data that comes from the
       templates file, while questions are used to store dynamic data,
       like the current value of the question, whether a user has seen
       a question, and so on. Keep the distinction between a template
       and a question in mind, but don't worry too much about it.

REGISTER template question
       This creates a new question that is bound to a template. By
       default each template has an asso- ciated question with the
       same name. However, any number of questions can really be
       associated with a template, and this lets you create more such
       questions.

This is quite different from *shared* templates:

SHARED TEMPLATES
       It's actually possible to have a template and a question that
       are shared among a set of packages. All the packages have to
       provide an identical copy of the template in their templates
       files. This can be useful if a bunch of packages need to ask
       the same question, and you only want to bother the user with it
       once. Shared templates are generally put in the shared/
       pseudo-directory in the debconf tem- plate namespace.






Reply to: