summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-11-07 14:45:58 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-11-07 14:45:58 +0000
commit8225178a24911e82aa2bb6ee6ee4cd206933baf9 (patch)
tree49b7d2b42249c667958f1159f7f3336cb77541fe
parent419a368acbb540db6ae8cff8efb04dca76824409 (diff)
downloaddrakx-backup-do-not-use-8225178a24911e82aa2bb6ee6ee4cd206933baf9.tar
drakx-backup-do-not-use-8225178a24911e82aa2bb6ee6ee4cd206933baf9.tar.gz
drakx-backup-do-not-use-8225178a24911e82aa2bb6ee6ee4cd206933baf9.tar.bz2
drakx-backup-do-not-use-8225178a24911e82aa2bb6ee6ee4cd206933baf9.tar.xz
drakx-backup-do-not-use-8225178a24911e82aa2bb6ee6ee4cd206933baf9.zip
create and handle always_i18n_xxx clp's
-rw-r--r--move/Makefile1
-rwxr-xr-xmove/make_live_tree_boot9
-rw-r--r--move/move.pm18
3 files changed, 26 insertions, 2 deletions
diff --git a/move/Makefile b/move/Makefile
index 67cd5e506..4abaf5b30 100644
--- a/move/Makefile
+++ b/move/Makefile
@@ -65,6 +65,7 @@ live_tree_boot:
$(MAKE) /tmp/live_tree_always.clp
$(MAKE) /tmp/live_tree_boot.clp
$(MAKE) /tmp/live_tree_totem.clp
+ $(MAKE) $(patsubst %, /tmp/live_tree_always_i18n_%.clp, $(LANG_FILES))
live_tree_boot_all:
cd /tmp/live_tree ; find -type l | cpio -pd /tmp/live_tree_boot_all
diff --git a/move/make_live_tree_boot b/move/make_live_tree_boot
index b272af94e..73422dab5 100755
--- a/move/make_live_tree_boot
+++ b/move/make_live_tree_boot
@@ -3,6 +3,7 @@
use MDK::Common;
my $prefix = '/tmp/live_tree';
+my @ALLOWED_LANGS = split(' ', first(cat_('move.pm') =~ /ALLOWED_LANGS = qw\((.*)\)/));
sub create_light_tree {
my ($live_name, $list) = @_;
@@ -107,6 +108,7 @@ sub remove_light_tree {
my @always_list = chomp_(cat_('data/always.list'));
my @boot_list_orig = chomp_(cat_('data/boot.list'));
my @totem_list_orig = chomp_(cat_('data/totem.list'));
+my @always_i18n_list = chomp_(cat_('data/always_i18n.list'));
@always_list = uniq(@always_list, intersection(\@boot_list_orig, \@totem_list_orig));
@@ -116,10 +118,17 @@ my @totem_list = difference2(\@totem_list_orig, \@always_list);
remove_light_tree('always', \@always_list);
remove_light_tree('boot', \@boot_list);
remove_light_tree('totem', \@totem_list);
+foreach my $lang (@ALLOWED_LANGS) {
+ remove_light_tree("always_i18n_$lang", []);
+}
if (!@ARGV) {
create_light_tree('always', \@always_list);
create_light_tree('boot', \@boot_list);
create_light_tree('totem', \@totem_list);
+ foreach my $lang (@ALLOWED_LANGS) {
+ my @list = map { my $s = $_; $s =~ s/__LANG__/$lang/; if_(-e $s, $s) } @always_i18n_list;
+ create_light_tree("always_i18n_$lang", \@list);
+ }
create_totem_links('totem', \@totem_list_orig);
}
diff --git a/move/move.pm b/move/move.pm
index f2ffd6ddb..72b3759c1 100644
--- a/move/move.pm
+++ b/move/move.pm
@@ -93,30 +93,44 @@ sub init {
drakx_stuff:
$o->{steps}{startMove} = { reachable => 1, text => "Start Move" };
+ $o->{steps}{handleMoveKey} = { reachable => 1, text => "Handle Move Key" };
$o->{orderedSteps_orig} = $o->{orderedSteps};
- $o->{orderedSteps} = [ qw(selectLanguage acceptLicense selectMouse selectKeyboard startMove) ];
+ $o->{orderedSteps} = [ qw(selectLanguage handleMoveKey acceptLicense selectMouse selectKeyboard startMove) ];
member($_, @ALLOWED_LANGS) or delete $lang::langs{$_} foreach keys %lang::langs;
}
sub lomount_clp {
- my ($name) = @_;
+ my ($name, $needed_file) = @_;
my ($clp, $dir) = ("/image_raw/live_tree_$name.clp", "/image_$name");
+ -e "$dir$needed_file" and return;
+
if (! -e $clp || cat_('/proc/cmdline') =~ /\blive\b/) {
symlink "/image_raw/live_tree_$name", $dir;
return;
}
+ log::l("lomount_clp: lomounting $name");
+
mkdir_p($dir);
my $dev = devices::find_free_loop();
run_program::run('losetup', '-r', '-e', 'gz', $dev, $clp);
run_program::run('mount', '-r', $dev, $dir);
}
+sub install2::handleMoveKey {
+ my $o = $::o;
+
+ lomount_clp("always_i18n_$o->{locale}{lang}", '/usr');
+}
+
sub install2::startMove {
my $o = $::o;
+ #- just in case
+ lomount_clp("always_i18n_$o->{locale}{lang}", '/usr');
+
if (cat_('/proc/cmdline') =~ /\buser=(\w+)/) {
$o->{users} = [ { name => $1 } ];
} else {