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

Re: Debconf utility?



On Sun, Feb 25, 2001 at 09:01:41PM -0500, Jon Eisenstein wrote:

> Has anyone created a utility to make debconf script-writing easier? Not
> that I'm too lazy to delve fully into the specifics of debconf, but for my
> first project I wonder if there's some tool to help me through it.

You don't have to delve fully into debconf to use it; try reading the tutorial.
It should give you enough to let you start using debconf, and you can find
answers to specific questions in the manual as they come up.

Perhaps it would help to look at existing packages for examples.  It's really
quite simple, unless you want to conditionally skip questions or ask them in a
different order.  At its simplest, your config script will look like:

. /usr/share/debconf/confmodule

db_input low my_package/question1 || true
db_input medium my_package/question1 || true
db_input high my_package/question1 || true
db_go || true

and your postinst:

db_get my_package/question1
# answer is in $RET
db_get my_package/question2
# same thing

Don't forget to Depend on debconf.

> I've been on this list long enough to be wary -- please don't start a
> flamewar based on this question. I don't want to be responsible for a war
> over whether or not one should be written, whether it makes developers too
> soft, or anything like that. This is just a simple query to find out if such
> a tool exists.

The operation is simple enough that a tool would be overkill.

-- 
 - mdz



Reply to: