summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-06-06 06:21:55 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-06-06 06:21:55 +0000
commit621d75e8ff3e03c640b9bf7191d157de81a11817 (patch)
treeb46a6d1c7c46ee9d85431aa62572af4609f39c93 /perl-install
parentfb2c096a8cbec7a65700099b4b1b7d6050bdcd56 (diff)
downloaddrakx-621d75e8ff3e03c640b9bf7191d157de81a11817.tar
drakx-621d75e8ff3e03c640b9bf7191d157de81a11817.tar.gz
drakx-621d75e8ff3e03c640b9bf7191d157de81a11817.tar.bz2
drakx-621d75e8ff3e03c640b9bf7191d157de81a11817.tar.xz
drakx-621d75e8ff3e03c640b9bf7191d157de81a11817.zip
get rid of $clicked and $ent_number (obsolete)
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/install2.pm86
-rw-r--r--perl-install/install_any.pm6
-rw-r--r--perl-install/install_steps.pm20
-rw-r--r--perl-install/install_steps_auto_install.pm3
-rw-r--r--perl-install/install_steps_gtk.pm10
-rw-r--r--perl-install/install_steps_interactive.pm28
6 files changed, 69 insertions, 84 deletions
diff --git a/perl-install/install2.pm b/perl-install/install2.pm
index 56d6682cd..2e2a4e0e9 100644
--- a/perl-install/install2.pm
+++ b/perl-install/install2.pm
@@ -89,45 +89,40 @@ sub installStepsCall {
#------------------------------------------------------------------------------
sub selectLanguage {
- my ($_clicked, $ent_number, $auto) = @_;
-
- installStepsCall($o, $auto, 'selectLanguage', $ent_number == 1);
+ my ($auto) = @_;
+ installStepsCall($o, $auto, 'selectLanguage');
}
sub acceptLicense {
- my ($_clicked, $_ent_number, $auto) = @_;
+ my ($auto) = @_;
installStepsCall($o, $auto, 'acceptLicense');
}
#------------------------------------------------------------------------------
sub selectMouse {
- my ($clicked, $ent_number, $auto) = @_;
-
- require pkgs;
- my $first_time = $ent_number == 1;
+ my ($auto) = @_;
+ installStepsCall($o, $auto, 'selectMouse');
- installStepsCall($o, $auto, 'selectMouse', !$first_time || $clicked);
-
- addToBeDone { mouse::write($o->do_pkgs, $o->{mouse}) if !$o->{isUpgrade} || $clicked } 'installPackages';
+ addToBeDone { mouse::write($o->do_pkgs, $o->{mouse}) if !$o->{isUpgrade} } 'installPackages';
}
#------------------------------------------------------------------------------
sub setupSCSI {
- my ($clicked, $_ent_number, $auto) = @_;
+ my ($auto) = @_;
if (!$::testing && !$::local_install) {
-d '/lib/modules/' . c::kernel_version() ||
-s modules::cz_file() or die N("Can not access kernel modules corresponding to your kernel (file %s is missing), this generally means your boot floppy in not in sync with the Installation medium (please create a newer boot floppy)", modules::cz_file());
}
- installStepsCall($o, $auto, 'setupSCSI', $clicked);
+ installStepsCall($o, $auto, 'setupSCSI');
}
#------------------------------------------------------------------------------
sub selectKeyboard {
- my ($clicked, $_ent_number, $auto) = @_;
+ my ($auto) = @_;
- installStepsCall($o, $auto, 'selectKeyboard', $clicked);
+ installStepsCall($o, $auto, 'selectKeyboard');
#- read keyboard ASAP (so that summary displays ok)
addToBeDone {
@@ -140,9 +135,9 @@ sub selectKeyboard {
#------------------------------------------------------------------------------
sub selectInstallClass {
- my ($clicked, $_ent_number, $auto) = @_;
+ my ($auto) = @_;
- installStepsCall($o, $auto, 'selectInstallClass', $clicked);
+ installStepsCall($o, $auto, 'selectInstallClass');
if ($o->{isUpgrade}) {
@{$o->{orderedSteps}} = uniq(map {
@@ -155,7 +150,7 @@ sub selectInstallClass {
#------------------------------------------------------------------------------
sub doPartitionDisks {
- my ($_clicked, $_ent_number, $auto) = @_;
+ my ($auto) = @_;
$o->{steps}{formatPartitions}{done} = 0;
installStepsCall($o, $auto, 'doPartitionDisksBefore');
installStepsCall($o, $auto, 'doPartitionDisks');
@@ -163,7 +158,7 @@ sub doPartitionDisks {
}
sub formatPartitions {
- my ($_clicked, $_ent_number, $auto) = @_;
+ my ($auto) = @_;
$o->{steps}{choosePackages}{done} = 0;
installStepsCall($o, $auto, 'choosePartitionsToFormat', $o->{fstab}) if !$o->{isUpgrade};
@@ -222,12 +217,12 @@ sub formatPartitions {
#------------------------------------------------------------------------------
sub choosePackages {
- my ($_clicked, $ent_number, $auto) = @_;
+ my ($auto) = @_;
require pkgs;
#- always setPackages as it may have to copy hdlist and synthesis files.
- installStepsCall($o, $auto, 'setPackages', $o->{isUpgrade} && $ent_number == 1);
- installStepsCall($o, $auto, 'choosePackages', $o->{packages}, $o->{compssUsers}, $ent_number == 1);
+ installStepsCall($o, $auto, 'setPackages');
+ installStepsCall($o, $auto, 'choosePackages');
my @flags = map_each { if_($::b, $::a) } %{$o->{rpmsrate_flags_chosen}};
log::l("rpmsrate_flags_chosen's: ", join(' ', sort @flags));
@@ -240,33 +235,32 @@ sub choosePackages {
#------------------------------------------------------------------------------
sub installPackages {
- my ($_clicked, $ent_number, $auto) = @_;
-
- installStepsCall($o, $auto, 'readBootloaderConfigBeforeInstall') if $ent_number == 1;
+ my ($auto) = @_;
+ installStepsCall($o, $auto, 'readBootloaderConfigBeforeInstall');
installStepsCall($o, $auto, 'beforeInstallPackages');
installStepsCall($o, $auto, 'installPackages');
installStepsCall($o, $auto, 'afterInstallPackages');
}
#------------------------------------------------------------------------------
sub miscellaneous {
- my ($clicked, $_ent_number, $auto) = @_;
+ my ($auto) = @_;
- installStepsCall($o, $auto, 'miscellaneousBefore', $clicked);
- installStepsCall($o, $auto, 'miscellaneous', $clicked);
- installStepsCall($o, $auto, 'miscellaneousAfter', $clicked);
+ installStepsCall($o, $auto, 'miscellaneousBefore');
+ installStepsCall($o, $auto, 'miscellaneous');
+ installStepsCall($o, $auto, 'miscellaneousAfter');
}
#------------------------------------------------------------------------------
sub summary {
- my ($_clicked, $ent_number, $auto) = @_;
+ my ($auto) = @_;
installStepsCall($o, $auto, 'summaryBefore');
- installStepsCall($o, $auto, 'summary', $ent_number == 1);
+ installStepsCall($o, $auto, 'summary');
installStepsCall($o, $auto, 'summaryAfter');
}
#------------------------------------------------------------------------------
sub configureNetwork {
- my ($_clicked, $_ent_number, $auto) = @_;
+ my ($auto) = @_;
#- get current configuration of network device.
require network::network;
eval { network::network::read_net_conf($o->{net}) };
@@ -274,40 +268,40 @@ sub configureNetwork {
}
#------------------------------------------------------------------------------
sub installUpdates {
- my ($_clicked, $_ent_number, $auto) = @_;
+ my ($auto) = @_;
installStepsCall($o, $auto, 'installUpdates') if $o->{meta_class} ne 'firewall';
}
#------------------------------------------------------------------------------
sub configureServices {
- my ($clicked, $_ent_number, $auto) = @_;
- installStepsCall($o, $auto, 'configureServices', $clicked);
+ my ($auto) = @_;
+ installStepsCall($o, $auto, 'configureServices');
}
#------------------------------------------------------------------------------
sub setRootPassword {
- my ($clicked, $_ent_number, $auto) = @_;
+ my ($auto) = @_;
return if $o->{isUpgrade};
- installStepsCall($o, $auto, 'setRootPassword', $clicked);
+ installStepsCall($o, $auto, 'setRootPassword');
}
#------------------------------------------------------------------------------
sub addUser {
- my ($clicked, $_ent_number, $auto) = @_;
+ my ($auto) = @_;
- installStepsCall($o, $auto, 'addUser', $clicked) if !$o->{isUpgrade};
+ installStepsCall($o, $auto, 'addUser') if !$o->{isUpgrade};
}
#------------------------------------------------------------------------------
sub setupBootloader {
- my ($_clicked, $ent_number, $auto) = @_;
+ my ($auto) = @_;
$o->{modules_conf}->write;
- installStepsCall($o, $auto, 'setupBootloaderBefore') if $ent_number == 1;
- installStepsCall($o, $auto, 'setupBootloader', $ent_number);
+ installStepsCall($o, $auto, 'setupBootloaderBefore');
+ installStepsCall($o, $auto, 'setupBootloader');
}
#------------------------------------------------------------------------------
sub configureX {
- my ($_clicked, $_ent_number, $auto) = @_;
+ my ($auto) = @_;
#- done here and also at the end of install2.pm, just in case...
install_any::write_fstab($o);
@@ -318,7 +312,7 @@ sub configureX {
}
#------------------------------------------------------------------------------
sub exitInstall {
- my ($_clicked, $_xent_number, $auto) = @_;
+ my ($auto) = @_;
installStepsCall($o, $auto, 'exitInstall', getNextStep($::o) eq 'exitInstall');
}
@@ -623,9 +617,7 @@ sub main {
$o->{steps}{$o->{step}}{entered}++;
$o->enteringStep($o->{step});
eval {
- &{$install2::{$o->{step}}}($o->{steps}{$o->{step}}{noauto},
- $o->{steps}{$o->{step}}{entered},
- $o->{steps}{$o->{step}}{auto});
+ &{$install2::{$o->{step}}}($o->{steps}{$o->{step}}{auto});
};
my $err = $@;
$o->kill_action;
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index da92d7f51..53e4cc0b3 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -592,7 +592,7 @@ sub load_rate_files {
}
sub setPackages {
- my ($o, $rebuild_needed) = @_;
+ my ($o) = @_;
require pkgs;
if (!$o->{packages} || is_empty_array_ref($o->{packages}{depslist})) {
@@ -600,8 +600,8 @@ sub setPackages {
1 while $suppl_method = $o->selectSupplMedia($suppl_method);
- #- open rpm db according to right mode needed.
- $o->{packages}{rpmdb} ||= pkgs::rpmDbOpen($rebuild_needed);
+ #- open rpm db according to right mode needed (ie rebuilding database if upgrading)
+ $o->{packages}{rpmdb} ||= pkgs::rpmDbOpen($o->{isUpgrade});
#- always try to select basic kernel (else on upgrade, kernel will never be updated provided a kernel is already
#- installed and provides what is necessary).
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index a3a212689..f1b5ab2a5 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -296,11 +296,11 @@ sub formatMountPartitions {
#------------------------------------------------------------------------------
sub setPackages {
- my ($o, $rebuild_needed) = @_;
+ my ($o) = @_;
- install_any::setPackages($o, $rebuild_needed);
+ install_any::setPackages($o);
pkgs::selectPackagesAlreadyInstalled($o->{packages});
- $rebuild_needed and pkgs::selectPackagesToUpgrade($o->{packages});
+ pkgs::selectPackagesToUpgrade($o->{packages}) if $o->{isUpgrade};
}
sub deselectFoundMedia {
@@ -312,7 +312,7 @@ sub selectSupplMedia { '' }
sub askSupplMirror { '' }
sub choosePackages {
- my ($o, $packages, $_compssUsers, $first_time) = @_;
+ my ($o) = @_;
#- now for upgrade, package that must be upgraded are
#- selected first, after is used the same scheme as install.
@@ -325,12 +325,10 @@ sub choosePackages {
add2hash_($o, { compssListLevel => 5 }) if !$::auto_install;
- #- avoid destroying user selection of packages but only
- #- for expert, as they may have done individual selection before.
- if ($first_time || !$::expert) {
- exists $o->{compssListLevel}
- and pkgs::setSelectedFromCompssList($packages, $o->{rpmsrate_flags_chosen}, $o->{compssListLevel}, $availableCorrected);
- }
+ #- !! destroying user selection of packages (they may have done individual selection before)
+ exists $o->{compssListLevel}
+ and pkgs::setSelectedFromCompssList($o->{packages}, $o->{rpmsrate_flags_chosen}, $o->{compssListLevel}, $availableCorrected);
+
$availableCorrected;
}
@@ -435,7 +433,7 @@ sub pkg_install {
}
}
-sub installPackages($$) { #- complete REWORK, TODO and TOCHECK!
+sub installPackages { #- complete REWORK, TODO and TOCHECK!
my ($o) = @_;
my $packages = $o->{packages};
diff --git a/perl-install/install_steps_auto_install.pm b/perl-install/install_steps_auto_install.pm
index 0933518cf..0c09fc6ed 100644
--- a/perl-install/install_steps_auto_install.pm
+++ b/perl-install/install_steps_auto_install.pm
@@ -26,8 +26,7 @@ sub new {
@ISA = ($interactiveClass, @ISA);
foreach my $f (@{$o->{orderedSteps}}) {
- my $auto_name = member($f, @{$o->{interactiveSteps}}) ? 'noauto' : 'auto';
- $o->{steps}{$f}{$auto_name} = 1;
+ $o->{steps}{$f}{auto} = 1 if !member($f, @{$o->{interactiveSteps}});
}
goto &{$::{$interactiveClass . "::"}{new}};
diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm
index 59f50ccdb..bb3c50e7b 100644
--- a/perl-install/install_steps_gtk.pm
+++ b/perl-install/install_steps_gtk.pm
@@ -170,26 +170,26 @@ sub charsetChanged {
#- Steps Functions
#-######################################################################################
sub selectLanguage {
- my ($o, $first_time) = @_;
+ my ($o) = @_;
$o->SUPER::selectLanguage;
$o->ask_warn('',
formatAlaTeX(N("Your system is low on resources. You may have some problem installing
Mandriva Linux. If that occurs, you can try a text install instead. For this,
-press `F1' when booting on CDROM, then enter `text'."))) if $first_time && availableRamMB() < 70; # 70MB
+press `F1' when booting on CDROM, then enter `text'."))) if availableRamMB() < 70; # 70MB
}
#------------------------------------------------------------------------------
sub selectMouse {
- my ($o, $force) = @_;
+ my ($o) = @_;
my %old = %{$o->{mouse}};
- $o->SUPER::selectMouse($force) or return;
+ $o->SUPER::selectMouse or return;
my $mouse = $o->{mouse};
$mouse->{type} eq 'none' ||
$old{type} eq $mouse->{type} &&
$old{name} eq $mouse->{name} &&
- $old{device} eq $mouse->{device} && !$force and return;
+ $old{device} eq $mouse->{device} and return;
while (1) {
my $x_protocol_changed = mouse::change_mouse_live($mouse, \%old);
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index d343ba145..2178d335c 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -389,16 +389,16 @@ sub formatMountPartitions {
#------------------------------------------------------------------------------
sub setPackages {
- my ($o, $rebuild_needed) = @_;
+ my ($o) = @_;
- my $w = $o->wait_message('', $rebuild_needed ? N("Looking for available packages and rebuilding rpm database...") :
+ my $w = $o->wait_message('', $o->{isUpgrade} ? N("Looking for available packages and rebuilding rpm database...") :
N("Looking for available packages..."));
- install_any::setPackages($o, $rebuild_needed);
+ install_any::setPackages($o);
$w->set(N("Looking at packages already installed..."));
pkgs::selectPackagesAlreadyInstalled($o->{packages});
- if ($rebuild_needed) {
+ if ($o->{isUpgrade}) {
$w->set(N("Finding packages to upgrade..."));
pkgs::selectPackagesToUpgrade($o->{packages});
}
@@ -444,11 +444,11 @@ sub selectSupplMedia {
}
#------------------------------------------------------------------------------
sub choosePackages {
- my ($o, $packages, $compssUsers, $_first_time) = @_;
+ my ($o) = @_;
#- this is done at the very beginning to take into account
#- selection of CD by user if using a cdrom.
- $o->chooseCD($packages) if install_any::method_allows_medium_change($o->{method});
+ $o->chooseCD($o->{packages}) if install_any::method_allows_medium_change($o->{method});
my $w = $o->wait_message('', N("Looking for available packages..."));
my $availableC = &install_steps::choosePackages;
@@ -456,7 +456,7 @@ sub choosePackages {
require pkgs;
- my $min_size = pkgs::selectedSize($packages);
+ my $min_size = pkgs::selectedSize($o->{packages});
undef $w;
if ($min_size >= $availableC) {
$o->ask_warn('', N("Your system does not have enough space left for installation or upgrade (%d > %d)",
@@ -467,12 +467,12 @@ sub choosePackages {
my $min_mark = 4;
chooseGroups:
- $o->chooseGroups($packages, $compssUsers, $min_mark, \$individual) if !$o->{isUpgrade} && $o->{meta_class} ne 'desktop';
+ $o->chooseGroups($o->{packages}, $o->{compssUsers}, $min_mark, \$individual) if !$o->{isUpgrade} && $o->{meta_class} ne 'desktop';
($o->{packages_}{ind}) =
- pkgs::setSelectedFromCompssList($packages, $o->{rpmsrate_flags_chosen}, $min_mark, $availableC);
+ pkgs::setSelectedFromCompssList($o->{packages}, $o->{rpmsrate_flags_chosen}, $min_mark, $availableC);
- $o->choosePackagesTree($packages) or goto chooseGroups if $individual;
+ $o->choosePackagesTree($o->{packages}) or goto chooseGroups if $individual;
install_any::warnAboutRemovedPackages($o, $o->{packages});
install_any::warnAboutNaughtyServers($o) or goto chooseGroups if !$o->{isUpgrade} && $o->{meta_class} ne 'firewall';
@@ -1226,7 +1226,7 @@ sub setupBootloaderBefore {
#------------------------------------------------------------------------------
sub setupBootloader {
- my ($o, $ent_number) = @_;
+ my ($o) = @_;
if (arch() =~ /ppc/) {
if (detect_devices::get_mac_generation() !~ /NewWorld/ &&
detect_devices::get_mac_model() !~ /IBM/) {
@@ -1243,11 +1243,7 @@ N("Error installing aboot,
try to force installation even if that destroys the first partition?"));
};
} else {
- if ($ent_number == 1) {
- any::setupBootloader_simple($o, $o->{bootloader}, $o->{all_hds}, $o->{fstab}, $o->{security}) or return;
- } else {
- any::setupBootloader($o, $o->{bootloader}, $o->{all_hds}, $o->{fstab}, $o->{security}) or return;
- }
+ any::setupBootloader_simple($o, $o->{bootloader}, $o->{all_hds}, $o->{fstab}, $o->{security}) or return;
any::installBootloader($o, $o->{bootloader}, $o->{all_hds}) or die "already displayed";
}
}