summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2005-03-17 15:55:02 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2005-03-17 15:55:02 +0000
commit0f48154802fec2290b26dfea4962d88fc236cab8 (patch)
tree63e87db2e8414f561e915690d6ed39540a6b366e
parentf5fbfe686c7e5856e63eb40b994ea709410869c2 (diff)
downloaddrakx-backup-do-not-use-0f48154802fec2290b26dfea4962d88fc236cab8.tar
drakx-backup-do-not-use-0f48154802fec2290b26dfea4962d88fc236cab8.tar.gz
drakx-backup-do-not-use-0f48154802fec2290b26dfea4962d88fc236cab8.tar.bz2
drakx-backup-do-not-use-0f48154802fec2290b26dfea4962d88fc236cab8.tar.xz
drakx-backup-do-not-use-0f48154802fec2290b26dfea4962d88fc236cab8.zip
(set_l10n_sort) stole it from rpmdrake
-rw-r--r--perl-install/common.pm14
1 files changed, 13 insertions, 1 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm
index e81253ed3..5c5168c4c 100644
--- a/perl-install/common.pm
+++ b/perl-install/common.pm
@@ -6,10 +6,11 @@ use diagnostics;
use strict;
use run_program;
use vars qw(@ISA @EXPORT $SECTORSIZE);
+use POSIX qw(setlocale LC_ALL LC_COLLATE);
@ISA = qw(Exporter);
# no need to export ``_''
-@EXPORT = qw($SECTORSIZE N N_ check_for_xserver files_exist formatTime formatXiB is_xbox makedev mandrake_release removeXiBSuffix require_root_capability salt setVirtual set_alternative set_permissions translate unmakedev untranslate);
+@EXPORT = qw($SECTORSIZE N N_ check_for_xserver files_exist formatTime formatXiB is_xbox makedev mandrake_release removeXiBSuffix require_root_capability salt setVirtual set_alternative set_l10n_sort set_permissions translate unmakedev untranslate);
# perl_checker: RE-EXPORT-ALL
push @EXPORT, @MDK::Common::EXPORT;
@@ -81,6 +82,17 @@ sub untranslate {
die "untranslate failed";
}
+sub set_l10n_sort() {
+ my $collation_locale = $ENV{LC_ALL};
+ if ($collation_locale) {
+ $collation_locale =~ /UTF-8/ or setlocale(LC_ALL, "$collation_locale.UTF-8");
+ } else {
+ $collation_locale = setlocale(LC_COLLATE);
+ $collation_locale =~ /UTF-8/ or setlocale(LC_COLLATE, "$collation_locale.UTF-8");
+ }
+}
+
+
BEGIN { undef *availableRamMB }
sub availableRamMB() {
my $s = MDK::Common::System::availableRamMB();