~ubuntu-branches/ubuntu/oneiric/localization-config/oneiric

« back to all changes in this revision

Viewing changes to conffiles.d/locale.postinst

  • Committer: Bazaar Package Importer
  • Author(s): Konstantinos Margaritis
  • Date: 2004-12-10 19:10:18 UTC
  • Revision ID: james.westby@ubuntu.com-20041210191018-wdjfbljdie570dld
Tags: 0.109
* Translations
  - Added Finnish by Tapio Lehtonen. Closes: #281040
  - Fixed Spanish translation (was too long). Closes: #284570

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
# The wrapper script for locales (post-install)
 
3
# Note: for sarge, locale configuration is done from the
 
4
# debian-installer at installation. so the sarge/locale
 
5
# script is a dummy.
 
6
 
 
7
use strict;
 
8
use warnings;
 
9
use Getopt::Long;
 
10
 
 
11
my $debug;
 
12
 
 
13
# Get command line options
 
14
GetOptions("debug" => \$debug);
 
15
 
 
16
# We use methods in common.pl
 
17
require '/usr/lib/localization-config/common/common.pl';
 
18
 
 
19
# The path where the scripts are kept
 
20
my $LIB = '/usr/lib/localization-config';
 
21
 
 
22
# call init() to initialize the APT config system
 
23
init();
 
24
 
 
25
# Define the version map for locales
 
26
my %vermap = ( '2.2.5-11.5',     => { RELEASE => 'woody' },
 
27
               '2.3.0-1',        => { RELEASE => 'sarge' }
 
28
              );
 
29
 
 
30
# Get locale entry
 
31
my $lang = shift;
 
32
 
 
33
my $script = "locale";
 
34
my $package = "locales";
 
35
 
 
36
if (is_installed($package)) {
 
37
    # Get appropriate release for this package
 
38
    my $release = get_release($package, %vermap);
 
39
 
 
40
    # Execute the corresponding script
 
41
    $script = "$LIB/$release/".$script;
 
42
    print "Running $script $lang\n" if $debug;
 
43
    system ($script, $lang) if -x $script;
 
44
}
 
45
 
 
46
1;