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

Re: debconf in preinst and postinst?



On Mon, May 28, 2001 at 02:03:14PM -0400, Joey Hess wrote:
> 
> No, the GET command retreives the answer to a question so the postinst
> can act on it. Look at the turorial again, you will see the config
> script uses an INPUT command to ask that same question.
Now this is confusing like accounting, everything is inversed. I use INPUT
to OUPUT a note, ok. And I use GET to set a variable to the return value.
Once I stop trying to interprete the meaning of the commands, it actually
makes sense, like accounting...
 
> No, your config script should test for this situation if possible, and
> you should display the message there with the INPUT command.
And I act on the situation in the postinst script, without any further
display, since this happened already in the config? Seems to work now.
 
> > # Old scorefile
> > db_get moon-buggy-esd/old_score_file || true
> > db_go
> 
> I don't see the point of retreiving the value of the question
> moon-buggy-esd/old_score_file if you do nothing with it. 
> You probably meant to use db_input.
Yup. Now just one more newbie question, what does the " || true" do? 
It is not setting the default answer (which is probably set in the templates
files), its OR-ing the return value of db_* with true? Do I need to use this?
I do not see the sense in this.

> > if [ "$1" = configure ]
> > then
> > # (Re)move old scorefile and directory if it exists
> >   if [ -e /var/lib/games/moon-buggy/mbscore ]
> >   then 
> >     db_get moon-buggy-esd/old_score_file
> >     mv files around...
> 
> Why are you calling the GET command again, and again ignoring whatever
> it returns?
Um, right, I wanted to OUTPUT (that is INPUT) something. I do not need
db_get at all, since it was just displaying a note, I probably do not get a
meaningful return value?
 
> Debconf allows multiple packages to contain templates and questions with
> the same name. It keeps track of what packages include them, and will
> only remove the templates and questions when all of those packages are
> purged. This is all done automatically (except for requiring you call
> the PURGE command in yout postrm on purge, which debhelper does for
> you).
Should I used shared/moon-buggy for this? Or is moon-buggy sufficient?

Thanks,
Christian



Reply to: