summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/ChangeLog15
-rw-r--r--perl-install/fs.pm10
-rw-r--r--perl-install/install2.pm7
-rw-r--r--perl-install/install_gtk.pm5
-rw-r--r--perl-install/install_steps.pm10
-rw-r--r--perl-install/install_steps_gtk.pm4
-rw-r--r--perl-install/install_steps_interactive.pm3
-rw-r--r--perl-install/modules.pm2
-rw-r--r--perl-install/pkgs.pm6
-rw-r--r--perl-install/printerdrake.pm4
10 files changed, 40 insertions, 26 deletions
diff --git a/perl-install/ChangeLog b/perl-install/ChangeLog
index 178c4be46..982575f19 100644
--- a/perl-install/ChangeLog
+++ b/perl-install/ChangeLog
@@ -1,3 +1,18 @@
+2000-09-25 François Pons <fpons@mandrakesoft.com>
+
+ * fs.pm: updated for live upgrade.
+ * install2.pm: dropped unuseful steps filtering.
+ * install_gtk.pm: removed window restrictions of live upgrade.
+ * install_steps.pm: fixed initrd symlink following in case of
+ upgrade.
+ * install_steps_gtk.pm, install_steps_interactive.pm: keep always
+ upgrade on live upgrade.
+ * modules.pm: may fixed pcmcia lost driver (typically on network).
+ * pkgs.pm: fixed (uggly?) usage of floating perl data on perl
+ script :-)
+ * printerdrake.pm: make sure an expert can choose among available
+ devices.
+
2000-09-25 dam's <damien@mandrakesoft.com>
* network.pm (write_resolv_conf): write '# ppp temp entry adsl' in
diff --git a/perl-install/fs.pm b/perl-install/fs.pm
index 5b13ea6a6..8a0f78ef3 100644
--- a/perl-install/fs.pm
+++ b/perl-install/fs.pm
@@ -54,7 +54,7 @@ sub check_mounted($) {
open H, "/proc/swaps";
foreach (<F>, <G>, <H>) {
foreach my $p (@$fstab) {
- /$p->{device}\s+([^\s]*)\s+/ and $p->{realMntpoint} = $1, $p->{isMounted} = $p->{isFormatted} = 1;
+ /$p->{device}\s+([^\s]*)\s+/ and $p->{mntpoint} = $1, $p->{isMounted} = $p->{isFormatted} = 1, print STDERR "ok for $p->{mntpoint} with mounted=$p->{isMounted}\n";
}
}
}
@@ -335,9 +335,11 @@ sub write($$$$) {
my ($prefix, $fstab, $manualFstab, $useSupermount) = @_;
$fstab = [ @{$fstab||[]}, @{$manualFstab||[]} ];
- log::l("resetting /etc/mtab");
- local *F;
- open F, "> $prefix/etc/mtab" or die "error resetting $prefix/etc/mtab";
+ unless ($::live) {
+ log::l("resetting /etc/mtab");
+ local *F;
+ open F, "> $prefix/etc/mtab" or die "error resetting $prefix/etc/mtab";
+ }
my ($floppy) = detect_devices::floppies();
diff --git a/perl-install/install2.pm b/perl-install/install2.pm
index 03e0b591b..94b11e9fa 100644
--- a/perl-install/install2.pm
+++ b/perl-install/install2.pm
@@ -252,7 +252,7 @@ sub selectInstallClass {
$o->selectPackagesToUpgrade if $o->{isUpgrade};
}
if ($o->{isUpgrade}) {
- @{$o->{orderedSteps}} = map { /setupSCSI/ ? ($_, "doPartitionDisks") : $_ }
+ @{$o->{orderedSteps}} = map { /setupSCSI/ ? ($_, "doPartitionDisks") : $_ }
grep { !/doPartitionDisks/ } @{$o->{orderedSteps}};
my $s; foreach (@{$o->{orderedSteps}}) {
$s->{next} = $_ if $s;
@@ -545,11 +545,6 @@ sub main {
$o->{prefix} = $::testing ? "/tmp/test-perl-install" : $::live ? "" : "/mnt";
$o->{root} = $::testing ? "/tmp/root-perl-install" : "/";
if ($::live) {
- @{$o->{orderedSteps}} = grep { /choosePackages/ || /installPackages/ } @{$o->{orderedSteps}};
- my $s; foreach (@{$o->{orderedSteps}}) {
- $s->{next} = $_ if $s;
- $s = $o->{steps}{$_};
- }
$o->{isUpgrade} = 1;
#$::beginner = 0; #- use custom by default.
}
diff --git a/perl-install/install_gtk.pm b/perl-install/install_gtk.pm
index acf5376fb..0cb9e8b67 100644
--- a/perl-install/install_gtk.pm
+++ b/perl-install/install_gtk.pm
@@ -89,7 +89,6 @@ sub create_big_help {
#------------------------------------------------------------------------------
sub create_help_window {
my ($o) = @_;
- $::live and return;
my $w;
if ($w = $o->{help_window}) {
@@ -115,7 +114,6 @@ sub create_help_window {
#------------------------------------------------------------------------------
sub create_steps_window {
my ($o) = @_;
- $::live and return;
my $PIX_H = my $PIX_W = 21;
@@ -127,7 +125,7 @@ sub create_steps_window {
$w->{rwindow}->set_usize($::stepswidth, $::stepsheight);
$w->{rwindow}->set_name('Steps');
$w->{rwindow}->set_events('button_press_mask');
- $w->show;
+ #$w->show;
gtkadd($w->{window},
gtkpack_(new Gtk::VBox(0,0),
@@ -182,7 +180,6 @@ sub create_steps_window {
#------------------------------------------------------------------------------
sub create_logo_window {
my ($o) = @_;
- $::live and return;
gtkdestroy($o->{logo_window});
my $w = bless {}, 'my_gtk';
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index 18a188a73..39b67f512 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -682,14 +682,18 @@ sub readBootloaderConfigBeforeInstall {
#- since kernel or kernel-smp may not be upgraded, it should be checked
#- if there is a need to update existing lilo.conf entries by following
#- symlinks before kernel or other packages get installed.
+ #- update everything that could be a filename (for following symlink).
foreach my $e (@{$o->{bootloader}{entries}}) {
while (my $v = readlink "$o->{prefix}/$e->{kernel_or_dev}") {
- $v = "/boot/$v" if $v !~ m|^/|;
- log::l("testing for presence of file $o->{prefix}$v");
- -e "$o->{prefix}$v" or last;
+ $v = "/boot/$v" if $v !~ m|^/|; -e "$o->{prefix}$v" or last;
log::l("renaming /boot/$e->{kernel_or_dev} entry by $v");
$e->{kernel_or_dev} = $v;
}
+ while (my $v = readlink "$o->{prefix}/$e->{initrd}") {
+ $v = "/boot/$v" if $v !~ m|^/|; -e "$o->{prefix}$v" or last;
+ log::l("renaming /boot/$e->{initrd} entry by $v");
+ $e->{initrd} = $v;
+ }
}
}
diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm
index 6ae0b53e1..d46a7e289 100644
--- a/perl-install/install_steps_gtk.pm
+++ b/perl-install/install_steps_gtk.pm
@@ -142,7 +142,7 @@ press `F1' when booting on CDROM, then enter `text'.")) if $first_time && availa
#------------------------------------------------------------------------------
sub selectInstallClass1 {
my ($o, $verif, $l, $def, $l2, $def2) = @_;
- $::live and $o->SUPER::selectInstallClass1(@_);
+ $::live and return $o->SUPER::selectInstallClass1($verif, $l, $def, $l2, $def2);
my $w = my_gtk->new('');
my ($radio, $focused);
@@ -238,7 +238,7 @@ a percentage of %d%% will install as many packages as possible.", $percentage, $
}); &$changed();
$spin->signal_connect(activate => sub { $w->{retval} = 1; Gtk->main_quit });
$spin->grab_focus();
- $w->main and $val;
+ $w->main and $val + 1; #- add a single byte (hack?) to make selection of 0 bytes ok.
}
sub choosePackagesTree {
my ($o, $packages, $compss) = @_;
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index af26cb58c..c0dfe4308 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -101,7 +101,7 @@ sub selectInstallClass1 {
my ($o, $verif, $l, $def, $l2, $def2) = @_;
$verif->($o->ask_from_list(_("Install Class"), _("Which installation class do you want?"), $l, $def));
- $::live or $o->ask_from_list_(_("Install/Rescue"), _("Is this an install or a rescue?"), $l2, $def2);
+ $::live ? 'Rescue' : $o->ask_from_list_(_("Install/Rescue"), _("Is this an install or a rescue?"), $l2, $def2);
}
#------------------------------------------------------------------------------
@@ -134,6 +134,7 @@ are you ready to answer that kind of questions?"),
first(list2kv(@c)), ${{reverse %c}}{$::beginner ? "beginner" : $::expert ? "expert" : "specific"},
[ __("Install"), __("Rescue") ], $o->{isUpgrade} ? "Rescue" : "Install") eq "Rescue";
+ print STDERR "isUpgrade=$o->{isUpgrade}\n";
if ($::corporate || $::beginner) {
delete $o->{installClass};
} else {
diff --git a/perl-install/modules.pm b/perl-install/modules.pm
index d0e77ec83..a8b5c3939 100644
--- a/perl-install/modules.pm
+++ b/perl-install/modules.pm
@@ -602,7 +602,7 @@ sub get_that_type {
grep {
my $l = $drivers{$_->{driver}};
- $l && $l->{type} =~ /$type/ && detect_devices::check($_);
+ ($_->{type} =~ /$type/ || $l && $l->{type} =~ /$type/) && detect_devices::check($_);
} detect_devices::probeall('');
}
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index d71ff768a..bb1e66ba7 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -195,9 +195,9 @@ sub extractHeaders($$$) {
#- a limit to change the approximation to use a linear one.
#- for information above this point, we have the corrected size below the
#- original size wich is absurd, this point is named D below.
-my $A = -1.21568e-05;
-my $B = 1.21561;
-my $C = -23.9889; #- doesn't take hdlist's into account as getAvailableSpace will do it.
+my $A = -121568/100000000000; # -1.21568e-05; #- because perl does like that on some language (TO BE FIXED QUICKLY)
+my $B = 121561/100000; # 1.21561
+my $C = -239889/10000; # -23.9889 #- doesn't take hdlist's into account as getAvailableSpace will do it.
my $D = (-sqrt(sqr($B - 1) - 4 * $A * $C) - ($B - 1)) / 2 / $A; #- $A is negative so a positive solution is with - sqrt ...
sub correctSize { $_[0] < $D ? ($A * $_[0] + $B) * $_[0] + $C : $_[0] } #- size correction in MB.
sub invCorrectSize { $_[0] < $D ? (sqrt(sqr($B) + 4 * $A * ($_[0] - $C)) - $B) / 2 / $A : $_[0]; } #- size correction in MB.
diff --git a/perl-install/printerdrake.pm b/perl-install/printerdrake.pm
index 08c79ee94..de5a99b6a 100644
--- a/perl-install/printerdrake.pm
+++ b/perl-install/printerdrake.pm
@@ -35,9 +35,9 @@ sub setup_local($$$) {
$_->{val}{DESCRIPTION} and push @str, _("A printer, model \"%s\", has been detected on ",
$_->{val}{DESCRIPTION}) . $_->{port};
}
- if (@str) {
+ if (!$::expert && @str) {
@port = map { $_->{port} } grep { $_->{val}{DESCRIPTION} } @parport;
- !$::expert && @port > 0 and $in = undef;
+ @port > 0 and $in = undef;
} else {
@port = detect_devices::whatPrinterPort();
}