#!<> use INSTALL::common; use INSTALL::global; use INSTALL::parameter; use INSTALL::locale; my $pParameters = \%INSTALL::parameter::variables; #============================================================================== #------------------------ Default global values #============================================================================== $pParameters->{asphome} = "<>"; $pParameters->{com_layer} = "<>"; INSTALL::common::set_standard_globals; my $pGlobals = \%INSTALL::global::variables; my $pOS = \%INSTALL::os::Details; sub usage { printf("usage: list-locales [refresh]\n"); exit(1); } #============================================================================== #------------------------ Validate all the required parameters. #============================================================================== my %PARAM_REQUIREMENTS = ( OPTIONAL => [ 'refresh', 'all' ] ); if (boolean_value($pParameters->{'--help'})) { usage(); } unless(INSTALL::parameter::verify(%PARAM_REQUIREMENTS)) { exit(1); } if ((@ARGV > 1) || ((@ARGV == 1) && (not grep { $ARGV[0] =~ /^$_$/} @{$PARAM_REQUIREMENTS{OPTIONAL}}))) { usage(); } if (exists $pParameters->{refresh}) { INSTALL::locale::build_locale_cache("$pParameters->{asphome}/INSTALL/.locale-cache"); } foreach my $locale (INSTALL::locale::listlocales) { print("$locale\n"); } exit(0);