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

Re: Conditional use of debconf



On Sat, Jan 05, 2002 at 07:22:18PM -0500, Stefan Hornburg (Racke) wrote:
> >      I would like to use debconf to present a message to the admin
> > when a package is installed, but only if certain text does not
> > appear in a config file.  
> > 
> >      Without debconf, I could use code something like this in the
> > [post|pre]inst:
> > 
> >      if !grep -q include /etc/dictd.conf
> >        then
> >        [Display message]
> >      fi
> > 
> >      I can't find anything in the debconf documentation or the command
> > available in /usr/share/doc/debian-policy/debconf_specification.txt.gz
> > that would permit this type of conditional display of a message.  Is
> > there something in the debconf documentation that I'm missing?
> 
> Within .config:
> 
> if !grep -q include /etc/dictd.conf
> 	db_input medium foo/bar-message || [ $? -eq 30 ]
> 	db_go
> fi

Note that the same can/should be done in the postinst -- the config file
gets run even before the preinst, so it may not be what you want.

I had the exact same thing done in the xinetd postinst, not sure if it's
still there.

-- 
     2. That which causes joy or happiness.



Reply to: