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

Re: Common set of debconf templates

On Wed, Oct 13, 2004 at 08:38:58AM -0400, sean finney wrote:

> if the templates are included at build-time by a debhelper-style script,
> there's no need for a runtime dependency for these templates.

But for shared/* debconf templates this means that all packages using that
template need to be rebuilt against the new template-providing package
after every change in its template contents. I think that is better to
split the roles, one template contains the real template and is not shared,
something like:

Template: dictionaries-common/default-ispell
Type: select
Choices: ${choices}
Description: The full and internationalized template description
Choices-es: ${choices}
Description-es: The template spanish translation

and shared templates with a dummy description (a single whitespace is
enough) for the packages that share the question (here all ispell dicts),
something like

Template: shared/packages-ispell
Type: text
Description: Dummy template, DO NOT TRANSLATE!!!

So things like the one below (in some sort of pseudo language, so untested)
in all of the owners .config files

sharedq = shared/packages-ispell
globalq = dictionaries-common/default-ispell

newchoices = metaget_owners($sharedq)
oldchoices = get_choices($globalq)

if ( $newchoices != $oldchoices ) {
  set_choices for $globalq to $newchoices
  unset_seen_flag ($globalq)

ask ($globalq)

and the appropriate stuff in the maintainer scripts should do the job.
This way upgrading po files only in package containing $globalq
completely upgrades the templates for this question, without the need of
rebuilding the packages sharing the related question. We are using
something of this kind in dictionaries-common for ispell dicts and
wordlists, although things are more complicated for us, because each
ispell dict can provide more than one possibility to the global owners
field, but doing things with just the package names should be much

> > (Pre-depends / Recommends / Installer business??)
> i think Pre-depends should be avoided at any possible cost.  this
> unfortunately means that the REGISTER suggestion won't reliably work,
> which is really too bad because that would have been the most graceful
> solution.

AFAIK templates are all read and registered to debconf database before
the .config files are run. Pre-Dependencies stage (configuring packages on
which other pre-depend) takes place later. Why register would not work if
called from .config and the package containing the global question is also
being installed? I think a plain dependency is all what is needed to
make sure the global template is present and read at the .templates stage. 

By the way, REGISTER looks a really nice approach for questions having
an essentially similar debconf template (not to be messed with shared/*
debconf templates). It might even be useful for shared/* questions instead
of the above schema.



Reply to: