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

Re: Problems with debconf files



Thus spoke Bob Hilliard <hilliard@debian.org> on 2002-03-11 10:55:29:
> Gergely Nagy <algernon@bonehunter.rulez.org> writes:
> 
> > Looking at the files on master, I think I know the problem. The quick
> > fix is to call db_get dict-web1913/reconf in your postinst. Also,
> > since config might be called at preinst time, it might not be a good
> > idea to check the filesystem. So I'd put the db_input and db_go lines
> > into the config, and move the check to the postinst, like this:
> > 
> > if ! grep -q "^include /var/lib/dictd/db.list"  /etc/dictd.conf
> > then
> > 	db_get dict-web1913/reconf
> > fi
> 
>      I had considered that I might have to move the entire config
> script to the postinst in order to have dpkg run it, but that would (I
> think) prevent it from being run during the pre-configuration phase.
> 
>      If I understand you correctly, you suggest leaving the:
> 
> db_input critical dict-web1913/reconf ||true
> db_go
>  
> lines in the config, but moving the conditional to the postinst.
> Would the sourcing of the debconf library be done in the config, the
> postinst, or both? 

Both.

> You suggest putting `db_get dict-web1913/reconf'
> in the postinst.  I don't currently have a `db_get' anywhere.

Yep, and that's the problem, I think :)


db_input gets the input from the user, db_go starts up debconf,
but db_get is the thing that retrieves the info from the database.
db_get makes it possible to not reask questions every time.

>      If it is done as you suggest, would an apt-get installation
> display the message in the pre-configuration phase, and again in the
> postinst, or is debconf smart enough to not show the same message
> twice?

debconf is smart enough. Of course, if the user asked debconf to display
questions every time, it would be displayed both at pre-config time and
during postinst (I think, I didn't try that).



Reply to: