On Mon, Feb 23, 2015 at 05:02:47PM -0500, Daniel Richard G. wrote:
> On Mon, 2015 Feb 23 13:29+0100, Agustin Martin wrote:
> > 
> > Hi, Daniel, 
> > 
> > This last lines show the reason for the problem you have. By the way,
> > things are working as expected.
> >
> > Pre-seeding is intended for first installation, when no elements
> > (wordlists, ispell dictionaries) are previously installed and apt-
> > utils is already installed (pre-seeding will not work with shared
> > questions otherwise). However, pre-seeding is not intended to work
> > once dictionaries are installed and a default value selected. This
> > default value will also be written to
> > "/var/cache/dictionaries-common/wordlist-default" (for wordlists) and
> > become the "true value". If it contains a valid value and different
> > from what debconf thinks, "true value" will win (I should have put it
> > under /etc, but changing it now does not worth) and debconf value will
> > be forcibly set to that "true value".
> 
> Okay, so the propagation is from wordlist-default to debconf, not the
> other way around. But isn't that inconsistent with this paragraph in the
> update-default-wordlist(8) man page?:
> 
>     When run normally (from the command line or with --trigger) this
>     script rebuilds the info at /var/cache/dictionaries-
>     common/wordlist.db after files under /var/lib/dictionaries-
>     common/wordlist, reads the system default from the debconf database
>     and unless disabled, set default symlinks in /etc/dictionaries-
>     common pointing to the appropriate files in /usr/share/dict/.

This belongs to the times where the default was only stored in debconf, I
have to fix it, thanks for the pointer.

> (There should probably be a mention of wordlist-default in there, and
> how it relates to debconf.)

It is intended for internal use, not for general use. I think it should
simply speak about default value and comment how to change it.

> >   1) Once new wordlist is installed, call `select-default-wordlist' as
> >      root and select the new value.
> 
> This does not appear to be scriptable, however. And isn't this the same
> as "dpkg-reconfigure dictionaries-common", going through debconf?

Both lead to the same result, as well as reconfiguring any wordlist.

> >   2) Temporarily set a debconf priority threshold lower than high
> >      (e.g. medium with DEBIAN_PRIORITY ENVAR, see debconf(7)) before
> >      installing the new wordlist. This will trigger the debconf
> >      question on instalation of the new wordlist.
> 
> One of the first things I do is set the default debconf priority to low,
> so this is covered. I'm getting the question (my pre-seeding includes
> "seen false")---but the value I pre-seeded is not the one selected.

Note that your pre-seeding procedure will not work for anything involving a
shared question with a backup of the default value stored somewhere unless
special care has been taken about this. It should however work if no backup
copy is stored.

> >   3) Manually change "/var/cache/dictionaries-common/wordlist-default"
> >      to the new value. Must be sure that the string is exactly one of
> >      the valid strings, in the same encoding as the original master
> >      string identifier.
> >
> >      *This is discouraged*. Using `select-default-wordlist' is largely
> >      preferred because 3) is more error prone. Incidentally, this is
> >      the reason why I put the backup value under /var insted of under
> >      /etc, so it is used internally in case of debconf database
> >      corruption, but leaves 1) as the preferred method.
> 
> This would be scriptable, but that error-prone-ness is why I was
> hoping for some leniency in what values are accepted. Could it be
> supported to do e.g.
> 
>     # echo english >/var/cache/dictionaries-common/wordlist-default
>     # update-default-wordlist
>     # cat /var/cache/dictionaries-common/wordlist-default
>     english (Webster's Second International English wordlist)

I am not inclined to have a non valid value in wordlist-default, even
if temporarily.  

I am however starting to think about something like

# update-default-wordlist --set-regexp-default="string"

that tries to match "string" to available values and if a single match is
found set it as default, failing loudly otherwise. This would be
scriptable and has IMHO the best of both worlds. "string" could be "webster"
or even "english" if only a leading match is considered, but I'd prefer
something more general, or at least having something more general as
fallback.
 
> > Also, this schema was designed way before debconf supported
> > internationalized choices, with the parenthesized text supposed to
> > contain the text in dictionary pseudo-language. This was some sort of
> > poor's man internationalization, but at that time no better choice was
> > available. And that string is internally used as master identifier for
> > each wordlist, so changing it will trigger new debconf questions
> > unless a lot of migration code is written. So, changing it does not
> > worth the work.
> 
> I'd be happy with the system accepting shorter values and "correcting"
> them to the longer canonical form, rather than simplifying the canonical
> forms themselves (though that would be very nice).

Current design has a number of known flaws. I comes from a time when debconf
was more limited and UTF-8 was not properly available. I would have designed
things differently now (something locale+variant based would have been way
simpler, but people wanted to preserve original package names and allow for
inclusion of more than one wordlist in a package, and I was just arrived to
Debian), but changing things now is just too noisy unless a lot of work is
put in this, and IMHO it does clearly not worth.

Let me think about the --set-regexp-default or a similar approach. That
might be very interesting.

Thank you very much for the feedback,

Regards,

-- 
Agustin


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to