#!/usr/bin/perl -w
use Debconf::Client::ConfModule q(:all);

version ('2.0');

my $class          = "wordlist";
my $script         = "/usr/share/dictionaries-common/dc-debconf-select.pl";
my $has_elanguages = "/usr/share/dictionaries-common/elanguages";

# This is not a standard dictionaries-common.config. Since dictionaries-common
# will eventually become an optional package, we need to make sure that
# wamerican does not run common config code unless a recent (e.g., with
# elanguages support) dictionaries-common is installed.
#
# This is not a problem when the whole system is installed from scratch, but
# can be when dictionaries-common and wamerican are upgraded together from
# previous non elanguages dictionaries-common version. In such case $script
# is present, so we need an extra check on $has_elanguages.

if ( -e $script && -e $has_elanguages ){
    require $script;
    dc_debconf_select($class);
}
