#!/usr/bin/perl
# The wrapper script for ispell (pre-install)
# Actually this preseeds the dictionaries-common package

use strict;
use warnings;
use Getopt::Long;

# We use methods in common.pl
require '/usr/lib/localization-config/common/common.pl';
require '/usr/lib/localization-config/common/log.pl';

# The path where the scripts are kept
my $LIB = '/usr/lib/localization-config';

# call init() to initialize the APT config system
init();

# Get lang entry
my $lang = $ARGV[0] or log_die("$0: No language given");

# Define the version map for dictionaries-common
my %vermap = ( '0.20-1',     => { RELEASE => 'sarge' }
              );

my $script = "dictionaries-common";
my $package = "dictionaries-common";

# Get appropriate release for this package
my $release = get_release($package, %vermap);

# Execute the corresponding script
$script = "$LIB/$release/".$script;
log_msg("$0: Running $script $lang");
system ($script, $lang) if -x $script;

1;
