summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-06-24 10:46:30 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-06-24 10:46:30 +0000
commit1dfc06422978cbae04f06f13165d2aea37fac8e1 (patch)
tree6272b1add0068da59fe9f58ba818e617dd7a0a29 /perl-install
parent2a0bbee296669686a3332e6595bc1021757249b0 (diff)
downloaddrakx-backup-do-not-use-1dfc06422978cbae04f06f13165d2aea37fac8e1.tar
drakx-backup-do-not-use-1dfc06422978cbae04f06f13165d2aea37fac8e1.tar.gz
drakx-backup-do-not-use-1dfc06422978cbae04f06f13165d2aea37fac8e1.tar.bz2
drakx-backup-do-not-use-1dfc06422978cbae04f06f13165d2aea37fac8e1.tar.xz
drakx-backup-do-not-use-1dfc06422978cbae04f06f13165d2aea37fac8e1.zip
no_comment
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/install2.pm2
-rw-r--r--perl-install/install_any.pm1
-rw-r--r--perl-install/install_steps.pm2
-rw-r--r--perl-install/install_steps_auto_install.pm30
-rw-r--r--perl-install/install_steps_gtk.pm27
-rw-r--r--perl-install/install_steps_interactive.pm2
-rw-r--r--perl-install/interactive.pm3
-rw-r--r--perl-install/lang.pm17
-rw-r--r--perl-install/modules.pm6
-rw-r--r--perl-install/my_gtk.pm1
-rw-r--r--perl-install/share/install.rc5
-rw-r--r--perl-install/share/themes-marble3d.rc5
12 files changed, 53 insertions, 48 deletions
diff --git a/perl-install/install2.pm b/perl-install/install2.pm
index d2fd9d458..3819c649e 100644
--- a/perl-install/install2.pm
+++ b/perl-install/install2.pm
@@ -162,7 +162,7 @@ $o = $::o = {
#- ],
shells => [ map { "/bin/$_" } qw(bash tcsh zsh ash ksh) ],
authentication => { md5 => 1, shadow => 1 },
- lang => 'en',
+ lang => 'en_US',
isUpgrade => 0,
toRemove => [],
toSave => [],
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index 7a5be64f1..07b80e222 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -589,6 +589,7 @@ sub g_auto_install(;$) {
local *F;
open F, ">$f" or log::l("can't output the auto_install script in $f"), return;
+ print F "# You should always check the syntax with 'perl -cw auto_inst.cfg.pl' before testing\n";
print F Data::Dumper->Dump([$o], ['$o']), "\0";
}
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index 0733ad852..151d6f3fc 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -120,7 +120,7 @@ sub selectInstallClass($@) {
#------------------------------------------------------------------------------
sub setupSCSI {
modules::load_ide();
- modules::load_thiskind('scsi');
+ modules::load_thiskind('scsi|raid');
}
#------------------------------------------------------------------------------
sub doPartitionDisks {
diff --git a/perl-install/install_steps_auto_install.pm b/perl-install/install_steps_auto_install.pm
index 333215dab..83c19c007 100644
--- a/perl-install/install_steps_auto_install.pm
+++ b/perl-install/install_steps_auto_install.pm
@@ -13,6 +13,21 @@ use common qw(:common);
use install_steps;
use log;
+my $graphical = 1;
+
+sub new {
+ my ($type, $o) = @_;
+
+ if ($graphical) {
+ require install_steps_gtk;
+ undef *enteringStep; *enteringStep = *install_steps_gtk::enteringStep;
+ undef *installPackages; *installPackages = *install_steps_gtk::installPackages;
+ goto &install_steps_gtk::new;
+ } else {
+ (bless {}, ref $type || $type)->SUPER::new($o);
+ }
+}
+
sub enteringStep($$$) {
my ($o, $step) = @_;
print _("Entering step `%s'\n", translate($o->{steps}{$step}{text}));
@@ -33,13 +48,18 @@ sub errorInStep {
}
sub exitInstall {
- my ($o) = @_;
+ my ($o, $alldone) = @_;
return if $o->{autoExitInstall};
- print "\a";
- print "Auto installation complete\n";
- print "Press <Enter> to reboot\n";
- <STDIN>;
+ if ($graphical) {
+ my $O = bless $o, "install_steps_gtk";
+ $O->exitInstall($alldone);
+ } else {
+ print "\a";
+ print "Auto installation complete\n";
+ print "Press <Enter> to reboot\n";
+ <STDIN>;
+ }
}
1;
diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm
index 7bf295fb8..032c33a7d 100644
--- a/perl-install/install_steps_gtk.pm
+++ b/perl-install/install_steps_gtk.pm
@@ -742,8 +742,6 @@ sub create_steps_window {
my ($o) = @_;
$o->{steps_window}->destroy if $o->{steps_window};
- my %reachableSteps if 0;
- %reachableSteps = ();
my $w = bless {}, 'my_gtk';
$w->{rwindow} = $w->{window} = new Gtk::Window;
@@ -751,14 +749,6 @@ sub create_steps_window {
$w->{rwindow}->set_usize($::stepswidth, $::stepsheight);
$w->{rwindow}->set_name("Steps");
$w->{rwindow}->set_events('button_press_mask');
- $w->{rwindow}->signal_connect(button_press_event => sub {
- $::setstep or return;
- my $Y = $_[1]{'y'};
- map_each {
- my (undef, $y, undef, $height) = @{$::b->allocation};
- $y <= $Y && $Y < $y + $height and die "setstep $::a\n";
- } %reachableSteps;
- });
$w->show;
my @steps_icons = map { [ gtkcreate_xpm($w->{window}, "$ENV{SHARE_PATH}/step-$_.xpm") ] } qw(green orange red);
@@ -766,15 +756,20 @@ sub create_steps_window {
gtkadd($w->{window},
gtkpack_(new Gtk::VBox(0,0),
(map {; 1, $_ } map {
+ my $step_name = $_;
my $step = $o->{steps}{$_};
my $w = new Gtk::Label(translate($step->{text}));
- $w->set_name("Steps" . ($step->{reachable} && "Reachable"));
- gtkpack_(my $b = new Gtk::HBox(0,5), 0,
- new Gtk::Pixmap(@{$steps_icons[$step->{done} ? 0 : $step->{entered} ? 1 : 2]}), 0, $w);
+ my $pixmap = new Gtk::Pixmap(@{$steps_icons[$step->{done} ? 0 : $step->{entered} ? 1 : 2]});
+ gtkpack_(my $b = new Gtk::HBox(0,5), 0, $pixmap, 0, $w);
+
+ $pixmap->set_events('enter_notify_mask');
+ $pixmap->signal_connect(enter_notify_event => sub { print "HERE\n" });
- $reachableSteps{$_} = $b if $step->{reachable};
- $b;
+ if ($step->{reachable}) {
+ gtksignal_connect(gtkadd(new Gtk::Button, $b),
+ clicked => sub { die "setstep $step_name\n" });
+ } else { $b }
} grep {
!eval $o->{steps}{$_}{hidden};
} @{$o->{orderedSteps}}),
@@ -782,7 +777,7 @@ sub create_steps_window {
my $t = $_;
my $w = new Gtk::Button('');
$w->set_name($t);
- $w->set_usize(0, 7);
+# $w->set_usize(0, 7);
gtksignal_connect($w, clicked => sub {
$::setstep or return; #- just as setstep s
install_theme($o, $t); die "theme_changed\n"
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index 6bca6cdad..e42245ba3 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -171,7 +171,7 @@ sub setupSCSI {
my ($o) = @_;
{ my $w = $o->wait_message(_("IDE"), _("Configuring IDE"));
modules::load_ide() }
- setup_thiskind($_[0], 'scsi', $_[1], $_[2]);
+ setup_thiskind($_[0], 'scsi|raid', $_[1], $_[2]);
}
sub ask_mntpoint_s {
diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm
index 8cef5ed7e..46abd8628 100644
--- a/perl-install/interactive.pm
+++ b/perl-install/interactive.pm
@@ -228,8 +228,7 @@ sub ask_from_entries_ref($$$$;$%) {
{ val => $_ }
} else {
if (@{$_->{list} || []} > 1) {
- add2hash_($_, { not_edit => 1 });
- add2hash_($_, { type => 'list' });
+ add2hash_($_, { not_edit => 1, type => 'list' });
${$_->{val}} = $_->{list}[0] if $_->{not_edit} && !member(${$_->{val}}, @{$_->{list}});
}
$_;
diff --git a/perl-install/lang.pm b/perl-install/lang.pm
index f072cd92b..1a41ad467 100644
--- a/perl-install/lang.pm
+++ b/perl-install/lang.pm
@@ -202,7 +202,7 @@ my %charsets = (
sub list { sort { $a cmp $b } map { $_->[0] } values %languages }
sub lang2text { $languages{$_[0]} && $languages{$_[0]}[0] }
-sub text2lang {
+sub text2lang {
my ($t) = @_;
foreach (keys %languages) {
lc($languages{$_}[0]) eq lc($t) and return $_;
@@ -210,18 +210,19 @@ sub text2lang {
die "unknown language $t";
}
-sub lang2charset { $languages{$_[0]} }
+sub lang2charset {
+ $languages{$_[0]} }
-sub set {
+sub set {
my ($lang) = @_;
- if ($lang) {
+ if ($lang && $languages{$lang}) {
#- use extract_archive that follow symlinks and expand directory.
#- it is necessary as there is a lot of symlinks inside locale.cz2,
#- using a compressed cpio archive is nighmare to extract all files.
#- reset locale environment variable to avoid any warnings by perl,
#- so installation of new locale is done with empty locale ...
- unless (-e "$ENV{SHARE_PATH}/locale/".$languages{$lang}[2]) {
+ unless (-e "$ENV{SHARE_PATH}/locale/$languages{$lang}[2]") {
@ENV{qw(LANG LC_ALL LANGUAGE LINGUAS)} = ();
eval { commands::rm("-r", "$ENV{SHARE_PATH}/locale") };
@@ -244,7 +245,7 @@ sub set {
}
}
-sub set_langs {
+sub set_langs {
my ($l) = @_;
$l or return;
$ENV{RPM_INSTALL_LANG} = member('all', @$l) ? 'all' :
@@ -252,7 +253,7 @@ sub set_langs {
log::l("RPM_INSTALL_LANG: $ENV{RPM_INSTALL_LANG}");
}
-sub write {
+sub write {
my ($prefix) = @_;
my $lang = $ENV{LC_ALL};
@@ -357,7 +358,7 @@ sub load_po($) {
sub load_console_font {
my ($lang) = @_;
- my ($charset) = $languages{$lang}[1] ;
+ my ($charset) = $languages{$lang} && $languages{$lang}[1] ;
my ($f, $u, $m) = @{$charsets{$charset} || []};
run_program::run('consolechars',
diff --git a/perl-install/modules.pm b/perl-install/modules.pm
index cdb8483a8..5925f9df5 100644
--- a/perl-install/modules.pm
+++ b/perl-install/modules.pm
@@ -388,7 +388,7 @@ sub load {
if ($type) {
add_alias('usb-interface', $name) if $type =~ /SERIAL_USB/i;
- add_alias('scsi_hostadapter', $name), load('sd_mod') if $type eq "scsi" || $type eq $type_aliases{scsi};
+ add_alias('scsi_hostadapter', $name), load('sd_mod') if $type =~ /scsi/ || $type eq $type_aliases{scsi};
}
$conf{$name}{options} = join " ", @options if @options;
}
@@ -554,7 +554,7 @@ sub load_thiskind($;&$) {
$loaded_text{$mod} = $text;
}
- if ($type eq 'scsi') {
+ if ($type =~ /scsi/) {
#- hey, we're allowed to pci probe :) let's do a lot of probing!
#- probe for USB SCSI.
@@ -574,7 +574,7 @@ sub load_thiskind($;&$) {
}
}
my @loaded = map { $loaded_text{$_} || $_ } @{$loaded{$type} || []};
- $type eq 'scsi' and @loaded and eval { load("sd_mod") };
+ $type =~ /scsi/ and @loaded and eval { load("sd_mod") };
@loaded;
}
diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm
index 533dccb67..4cb2e4657 100644
--- a/perl-install/my_gtk.pm
+++ b/perl-install/my_gtk.pm
@@ -504,7 +504,6 @@ sub _ask_from_list {
Gtk->timeout_remove($timeout) if $timeout; $timeout = '';
- print ord($c), "<<<<<<<<<\n";
if ($e->{keyval} >= 0x100) {
&$leave if $c eq "\r" || $c eq "\x8d";
$starting_word = '' if $e->{keyval} != 0xffe4; # control
diff --git a/perl-install/share/install.rc b/perl-install/share/install.rc
index 9d9d30db1..d08a29432 100644
--- a/perl-install/share/install.rc
+++ b/perl-install/share/install.rc
@@ -14,13 +14,8 @@ style "logo" = "background"
engine "pixmap" { image { function = FLAT_BOX } }
}
-style "stepsReachable"
-{
-}
-
widget "*" style "default-font"
widget "Steps" style "steps"
widget "*Steps*" style "small-font"
-widget "*StepsReachable*" style "stepsReachable"
widget "*logo*" style "logo"
diff --git a/perl-install/share/themes-marble3d.rc b/perl-install/share/themes-marble3d.rc
index 9f11ef583..5d38424ef 100644
--- a/perl-install/share/themes-marble3d.rc
+++ b/perl-install/share/themes-marble3d.rc
@@ -194,11 +194,6 @@ style "steps"
}
}
-style "stepsReachable"
-{
- fg[NORMAL] = { 0.25, 0.15, 0.05 }
-}
-
widget_class "GtkWindow" style "window"
widget_class "*" style "any"
widget_class "*GtkSpin*" style "entry"