summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-05-07 15:41:55 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-05-07 15:41:55 +0000
commit6e0714d453adf6cb59f3a8083d3561d5f274be16 (patch)
treef1b76708279145c1eb63b7d23f5c7d08648858a5 /perl-install
parentd91336f90687a1f2386f4941b1589c54af085983 (diff)
downloaddrakx-backup-do-not-use-6e0714d453adf6cb59f3a8083d3561d5f274be16.tar
drakx-backup-do-not-use-6e0714d453adf6cb59f3a8083d3561d5f274be16.tar.gz
drakx-backup-do-not-use-6e0714d453adf6cb59f3a8083d3561d5f274be16.tar.bz2
drakx-backup-do-not-use-6e0714d453adf6cb59f3a8083d3561d5f274be16.tar.xz
drakx-backup-do-not-use-6e0714d453adf6cb59f3a8083d3561d5f274be16.zip
no_comment
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/ChangeLog22
-rw-r--r--perl-install/any.pm4
-rw-r--r--perl-install/devices.pm4
-rw-r--r--perl-install/fsedit.pm3
-rw-r--r--perl-install/ftp.pm2
-rw-r--r--perl-install/install2.pm5
-rw-r--r--perl-install/install_steps.pm6
-rw-r--r--perl-install/install_steps_interactive.pm29
-rw-r--r--perl-install/interactive.pm6
-rw-r--r--perl-install/keyboard.pm4
-rw-r--r--perl-install/lang.pm13
-rw-r--r--perl-install/modules.pm4
-rw-r--r--perl-install/pkgs.pm7
13 files changed, 65 insertions, 44 deletions
diff --git a/perl-install/ChangeLog b/perl-install/ChangeLog
index f54311a99..b4a590f33 100644
--- a/perl-install/ChangeLog
+++ b/perl-install/ChangeLog
@@ -1,3 +1,25 @@
+2000-05-07 Pixel <pixel@mandrakesoft.com>
+
+ * modules.pm (text2driver): same as text2lang below
+ * keyboard.pm (text2keyboard): same as text2lang below
+ * lang.pm (text2lang): replace the while (... each) by a foreach
+ (keys) (because each is dangerous if loop is exited)
+
+ * install_steps_interactive.pm (selectKeyboard): better handling
+ of multiple langs question.
+
+ * ftp.pm (new): Timeout set to 60 (seconds), was default (120)
+
+ * install_steps_interactive.pm (setup_thiskind): remove ide-*
+ from modules displayed as loaded.
+
+2000-05-06 Pixel <pixel@mandrakesoft.com>
+
+ * fsedit.pm (check_mntpoint): verify that standard mntpoints (/
+ /usr) are not on not trueFS
+
+ * any.pm (setupBootloader): add $prefix for the 2 glob_'s
+
2000-05-07 Pablo Saratxaga <pablo@mandrakesoft.com>
* share/keyboards.tar.bz2: added Ukrainian keyboard xmodmap.ua
diff --git a/perl-install/any.pm b/perl-install/any.pm
index 7bbb4ee09..f4133399c 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -139,10 +139,10 @@ You can add some more or change the existing ones."),
my @l;
if ($e->{type} eq "image") {
@l = (
-_("Image") => { val => \$e->{kernel_or_dev}, list => [ eval { glob_("/boot/vmlinuz*") } ] },
+_("Image") => { val => \$e->{kernel_or_dev}, list => [ eval { map { s/$prefix// } glob_("$prefix/boot/vmlinuz*") } ] },
_("Root") => { val => \$e->{root}, list => [ map { "/dev/$_->{device}" } @$fstab ], not_edit => !$::expert },
_("Append") => \$e->{append},
-_("Initrd") => { val => \$e->{initrd}, list => [ eval { glob_("/boot/initrd*") } ] },
+_("Initrd") => { val => \$e->{initrd}, list => [ eval { map { s/$prefix// } glob_("$prefix/boot/initrd*") } ] },
_("Read-write") => { val => \$e->{'read-write'}, type => 'bool' }
);
@l = @l[0..5] unless $::expert;
diff --git a/perl-install/devices.pm b/perl-install/devices.pm
index ab05f3506..1b2289f4d 100644
--- a/perl-install/devices.pm
+++ b/perl-install/devices.pm
@@ -111,8 +111,8 @@ sub entry {
"sbpcd" => [ c::S_IFBLK(), 25, 0 ],
"sjcd" => [ c::S_IFBLK(), 18, 0 ],
"tty" => [ c::S_IFCHR(), 5, 0 ],
-# "usbmouse"=> [ c::S_IFCHR(), 10, 32], #- aka hidbp-mse-0
- "usbmouse"=> [ c::S_IFCHR(), 13, 32], #- aka /dev/usb/usbmouse0
+ "usbmouse"=> [ c::S_IFCHR(), 10, 32], #- aka hidbp-mse-0
+# "usbmouse"=> [ c::S_IFCHR(), 13, 32], #- aka /dev/usb/usbmouse0
"zero" => [ c::S_IFCHR(), 1, 5 ],
}}{$_} or die "unknown device $_" };
}
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm
index ccc198290..f66a3488b 100644
--- a/perl-install/fsedit.pm
+++ b/perl-install/fsedit.pm
@@ -36,7 +36,7 @@ arch() =~ /^sparc/ ? (
{ mntpoint => "/tmp", size => 50 << 11, type => 0x83, ratio => 3, maxsize => 500 << 11 },
{ mntpoint => "/mnt/iso", size => 700 << 11, type => 0x83 },
);
-my @suggestions_mntpoints = qw(/mnt/windows);
+my @suggestions_mntpoints = qw(/root /mnt/windows);
my @partitions_signatures = (
@@ -270,6 +270,7 @@ sub check_mntpoint {
$check->($fake_part) unless $mntpoint eq '/' && $loopbackDevice; #- '/' is a special case, no loop check
die "raid / with no /boot" if $mntpoint eq "/" && raid::is($part) && !has_mntpoint("/boot", $hds);
+ die _("You need a true filesystem (ext2, reiserfs) for this mount point\n") if !isTrueFS($part) && member($mntpoint, qw(/ /usr));
#- if ($part->{start} + $part->{size} > 1024 * $hd->cylinder_size() && arch() =~ /i386/) {
#- die "/boot ending on cylinder > 1024" if $mntpoint eq "/boot";
#- die "/ ending on cylinder > 1024" if $mntpoint eq "/" && !has_mntpoint("/boot", $hds);
diff --git a/perl-install/ftp.pm b/perl-install/ftp.pm
index 5bb5cfdf2..ffdd25aa3 100644
--- a/perl-install/ftp.pm
+++ b/perl-install/ftp.pm
@@ -30,7 +30,7 @@ sub new {
my @l = do { if ($hosts{"$host$prefix"}) {
@{$hosts{"$host$prefix"}};
} else {
- my %options = (Passive => 1);
+ my %options = (Passive => 1, Timeout => 60);
$options{Firewall} = $ENV{PROXY} if $ENV{PROXY};
$options{Port} = $ENV{PROXYPORT} if $ENV{PROXYPORT};
unless ($login) {
diff --git a/perl-install/install2.pm b/perl-install/install2.pm
index e7f7ee098..dadeac3d6 100644
--- a/perl-install/install2.pm
+++ b/perl-install/install2.pm
@@ -248,13 +248,12 @@ sub selectKeyboard {
return unless $o->{isUpgrade} || !$::beginner || $clicked;
$o->{keyboard} = (keyboard::read($o->{prefix}))[0] if $o->{isUpgrade} && !$clicked && $o->{keyboard_unsafe};
- $o->selectKeyboard if !$::beginner || $clicked;
+ $o->selectKeyboard;
#- if we go back to the selectKeyboard, you must rewrite
addToBeDone {
lang::write($o->{prefix});
keyboard::write($o->{prefix}, $o->{keyboard});
- lang::set_langs($o->{langs});
} 'doInstallStep' unless $::g_auto_install;
}
@@ -661,7 +660,7 @@ sub main {
eval { modules::load("af_packet") };
- lang::set($o->{lang}, $o->{langs});
+ lang::set($o->{lang});
#-the main cycle
my $clicked = 0;
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index bba158389..03115536c 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -87,7 +87,8 @@ sub set_help { 1 }
#------------------------------------------------------------------------------
sub selectLanguage {
my ($o) = @_;
- lang::set($o->{lang}, $o->{langs});
+ lang::set($o->{lang});
+ $o->{langs} ||= [ $o->{lang} ];
if ($o->{keyboard_unsafe} || !$o->{keyboard}) {
$o->{keyboard_unsafe} = 1;
@@ -98,7 +99,8 @@ sub selectLanguage {
#------------------------------------------------------------------------------
sub selectKeyboard {
my ($o) = @_;
- keyboard::setup($o->{keyboard})
+ keyboard::setup($o->{keyboard});
+ lang::set_langs($o->{langs});
}
#------------------------------------------------------------------------------
sub selectPath {}
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index 648ac4237..ada8e2c59 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -66,22 +66,23 @@ sub selectLanguage($) {
}
#------------------------------------------------------------------------------
sub selectKeyboard($) {
- my ($o) = @_;
- $o->{keyboard} =
- keyboard::text2keyboard($o->ask_from_list_(_("Keyboard"),
- _("Please, choose your keyboard layout."),
- [ keyboard::list() ],
- keyboard::keyboard2text($o->{keyboard})));
- delete $o->{keyboard_unsafe};
- install_steps::selectKeyboard($o);
-
-
+ my ($o, $clicked) = @_;
+ if (!$::beginner || $clicked) {
+ $o->{keyboard} =
+ keyboard::text2keyboard($o->ask_from_list_(_("Keyboard"),
+ _("Please, choose your keyboard layout."),
+ [ keyboard::list() ],
+ keyboard::keyboard2text($o->{keyboard})));
+ delete $o->{keyboard_unsafe};
+ }
if ($::expert) {
- my $langs = $o->ask_many_from_list('',
+ my %langs; $langs{$_} = 1 foreach @{$o->{langs}};
+ $o->ask_many_from_list_ref('',
_("You can choose other languages that will be available after install"),
- [ sort { $a cmp $b } lang::list() ]) or goto &selectLanguage;
- $o->{langs} = [ $o->{lang}, grep_index { $langs->[$::i] } lang::list() ];
+ [ lang::list() ], [ map { \$langs{lang::text2lang($_)} } lang::list() ] ) or goto &selectKeyboard;
+ $o->{langs} = [ grep { $langs{$_} } keys %langs ];
}
+ install_steps::selectKeyboard($o);
}
#------------------------------------------------------------------------------
sub selectRootPartition($@) {
@@ -1164,7 +1165,7 @@ sub setup_thiskind {
my $allow_probe = !$::expert || $o->ask_yesorno('', _("Try to find PCI devices?"), 1);
if ($allow_probe) {
- eval { @l = $o->load_thiskind($type) };
+ eval { @l = grep { !/ide-/ } $o->load_thiskind($type) };
$o->ask_warn('', $@) if $@;
return if $auto && (@l || !$at_least_one);
}
diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm
index 684f68179..96313f199 100644
--- a/perl-install/interactive.pm
+++ b/perl-install/interactive.pm
@@ -227,8 +227,10 @@ sub ask_from_entries_ref($$$$;$%) {
if ((ref $_) eq "SCALAR") {
{ val => $_ }
} else {
- add2hash_($_, { type => 'list' }) if @{$_->{list}} > 1; #- TODO: remove the if, not needed?
- ${$_->{val}} = $_->{list}[0] if $_->{not_edit} && !member(${$_->{val}}, @{$_->{list}});
+ if (@{$_->{list} || []} > 1) {
+ add2hash_($_, { type => 'list' });
+ ${$_->{val}} = $_->{list}[0] if $_->{not_edit} && !member(${$_->{val}}, @{$_->{list}});
+ }
$_;
}
} @$val ];
diff --git a/perl-install/keyboard.pm b/perl-install/keyboard.pm
index b312fc85a..969b24fbf 100644
--- a/perl-install/keyboard.pm
+++ b/perl-install/keyboard.pm
@@ -166,8 +166,8 @@ sub keyboard2kmap { $keyboards{$_[0]} && $keyboards{$_[0]}[1] }
sub keyboard2xkb { $keyboards{$_[0]} && $keyboards{$_[0]}[2] }
sub text2keyboard {
my ($t) = @_;
- while (my ($k, $v) = each %keyboards) {
- lc($v->[0]) eq lc($t) and return $k;
+ foreach (keys %keyboards) {
+ lc($keyboards{$_}[0]) eq lc($t) and return $_;
}
die "unknown keyboard $t";
}
diff --git a/perl-install/lang.pm b/perl-install/lang.pm
index a19990b2a..989c8aadb 100644
--- a/perl-install/lang.pm
+++ b/perl-install/lang.pm
@@ -199,18 +199,18 @@ my %charsets = (
#- Functions
#-######################################################################################
-sub list { map { $_->[0] } values %languages }
+sub list { sort { $a cmp $b } map { $_->[0] } values %languages }
sub lang2text { $languages{$_[0]} && $languages{$_[0]}[0] }
sub text2lang {
my ($t) = @_;
- while (my ($k, $v) = each %languages) {
- lc($v->[0]) eq lc($t) and return $k;
+ foreach (keys %languages) {
+ lc($languages{$_}[0]) eq lc($t) and return $_;
}
die "unknown language $t";
}
sub set {
- my ($lang, $langs) = @_;
+ my ($lang) = @_;
if ($lang) {
#- use extract_archive that follow symlinks and expand directory.
@@ -231,7 +231,6 @@ sub set {
$ENV{LANGUAGE} = $languages{$lang}[3];
#- apparently autoconf/automake doesn't like LINGUAS having a list of values
#- $ENV{LINGUAS} = $languages{$lang}[3];
- set_langs($langs || [$lang]);
} else {
# stick with the default (English) */
delete $ENV{LANG};
@@ -243,9 +242,11 @@ sub set {
}
sub set_langs {
- my ($l) = @_;
+ my ($l) = @_;
+ $l or return;
$ENV{RPM_INSTALL_LANG} = member('all', @$l) ? 'all' :
join ':', uniq(map { substr($languages{$_}[2], 0, 2) } @$l);
+ log::l("RPM_INSTALL_LANG: $ENV{RPM_INSTALL_LANG}");
}
sub write {
diff --git a/perl-install/modules.pm b/perl-install/modules.pm
index bbc1a04f7..198bc118f 100644
--- a/perl-install/modules.pm
+++ b/perl-install/modules.pm
@@ -335,8 +335,8 @@ sub text_of_type($) {
sub text2driver($) {
my ($text) = @_;
- while (my ($k, $v) = each %drivers) {
- $v->{text} eq $text and return $k;
+ foreach (keys %drivers) {
+ $drivers{$_}{text} eq $text and return $_;
}
die "$text is not a valid module description";
}
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index 99e3e854a..13ba2002b 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -596,13 +596,6 @@ sub readCompssUsers {
\%compssUsers, \@sorted;
}
-#- sub isLangSensitive($$) {
-#- my ($name, $lang) = @_;
-#- local $SIG{__DIE__} = 'none';
-#- $name =~ /-([^-]*)$/ or return;
-#- $1 eq $lang || eval { lang::text2lang($1) eq $lang } && !$@;
-#- }
-
sub setSelectedFromCompssList {
my ($compssListLevels, $packages, $min_level, $max_size, $install_class) = @_;
my $ind = $compssListLevels->{$install_class}; defined $ind or log::l("unknown install class $install_class in compssList"), return;