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

Re: gathering debconf information from another package



On Fri, Dec 14, 2001 at 11:37:35PM +0100, Robert Millan wrote:
> I need to obtain debconf information from my postinst
> with db_get from a package that isn't of mine.
> 
> do I need to set a pre-depends on it or is it enough
> with a depends?

a Depends: b means that a won't be configured until b has been
configured. Policy 7.2 puts it like this:

          The Depends field should also be used if the postinst, prerm or
          postrm scripts require the package to be present in order to
          run.

So yes, a plain dependency is enough. You'd need a pre-dependency if you
had a preinst that required another package to be configured (although
try to avoid that). If your debconf config script were to require
another package, no dependency field would suffice: the only packages
you can rely on in the config script are essential packages and debconf
itself.

(Interesting - I hadn't noticed the part of policy 7.2 before that talks
about what you can rely on in the prerm and postrm. On the odd occasion
where I've needed something there, I've just thrown in a plain
dependency and not worried about it too much.)

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Reply to: