diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2003-01-06 20:46:54 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2003-01-06 20:46:54 +0000 |
commit | 3e0c06ffc9c8e32dfeb433490f4e23b59144a48d (patch) | |
tree | 96796dbb918dd52c5bb1b0c700d356efc0558ad6 /perl-install | |
parent | 2c5cf855dfc78482ce540ec7c21250d34ad5d81e (diff) | |
download | drakx-3e0c06ffc9c8e32dfeb433490f4e23b59144a48d.tar drakx-3e0c06ffc9c8e32dfeb433490f4e23b59144a48d.tar.gz drakx-3e0c06ffc9c8e32dfeb433490f4e23b59144a48d.tar.bz2 drakx-3e0c06ffc9c8e32dfeb433490f4e23b59144a48d.tar.xz drakx-3e0c06ffc9c8e32dfeb433490f4e23b59144a48d.zip |
selectInstallClass now automatically detect if an existing install is there,
and propose update or install based on this
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/install_steps.pm | 22 | ||||
-rw-r--r-- | perl-install/install_steps_interactive.pm | 39 |
2 files changed, 31 insertions, 30 deletions
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index 7f20275cc..cc6bf5c9a 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -121,9 +121,7 @@ sub selectKeyboard { } #------------------------------------------------------------------------------ sub acceptLicence {} -sub selectPath {} -#------------------------------------------------------------------------------ -sub selectInstallClass {} + #------------------------------------------------------------------------------ sub setupSCSI { my ($o) = @_; @@ -131,6 +129,17 @@ sub setupSCSI { modules::load_ide(); modules::load_category('bus/firewire'); modules::load_category('disk/scsi|hardware_raid'); + + install_any::getHds($o, $o); +} + +#------------------------------------------------------------------------------ +sub selectInstallClass { + if ($o->{partitioning}{use_existing_root} || $o->{isUpgrade}) { + # either one root is defined (and all is ok), or we take the first one we find + my $p = fsedit::get_root_($o->{fstab}) || first(install_any::find_root_parts($o->{fstab}, $o->{prefix})) or die; + install_any::use_root_part($o->{all_hds}, $p, $o->{prefix}); + } } #------------------------------------------------------------------------------ @@ -183,13 +192,6 @@ sub doPartitionDisksAfter { sub doPartitionDisks { my ($o) = @_; - install_any::getHds($o); - - if ($o->{partitioning}{use_existing_root} || $o->{isUpgrade}) { - # either one root is defined (and all is ok), or we take the first one we find - my $p = fsedit::get_root_($o->{fstab}) || first(install_any::find_root_parts($o->{fstab}, $o->{prefix})) or die; - install_any::use_root_part($o->{all_hds}, $p, $o->{prefix}); - } if ($o->{partitioning}{auto_allocate}) { fsedit::auto_allocate($o->{all_hds}, $o->{partitions}); } diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index aa90cbce5..c1951a80c 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -128,13 +128,22 @@ sub selectKeyboard { sub selectInstallClass { my ($o) = @_; - my $installMode = $o->{isUpgrade} ? $o->{keepConfiguration} ? N_("Upgrade packages only") : N_("Upgrade") : N_("Install"); - - $installMode = exists $o->{isUpgrade} || $::live ? 'Update' : $o->ask_from_list_(N("Install/Update"), N("Is this an install or an update?"), [ N_("Install"), N_("Upgrade"), N_("Upgrade packages only") ], $installMode); - - log::l("install class: $installMode"); - $o->{isUpgrade} = $installMode =~ /Upgrade/; - $o->{keepConfiguration} = $installMode =~ /packages only/; + if (my @l = install_any::find_root_parts($o->{fstab}, $o->{prefix})) { + log::l("proposing to upgrade partitions " . join(" ", map { $_->{device} } @l)); + $p = $o->ask_from_listf(N("Install/Upgrade"), + N("Is this an install or an upgrade?"), + sub { + ref $_[0] ? (@l > 1 ? + N("Upgrade partition %s", partition_table::description($_[0])) : + N("Upgrade")) : + translate($_[0]); + }, [ @l, N_("Install") ]); + if (ref $p) { + log::l("choosing to upgrade partition $p->{device}"); + install_any::use_root_part($o->{all_hds}, $p, $o->{prefix}); + $o->{isUpgrade} = 1; + } + } } #------------------------------------------------------------------------------ @@ -199,6 +208,8 @@ sub setupSCSI { modules::interactive::load_category($o, 'disk/scsi|hardware_raid', !$::expert && !$clicked, 0); install_interactive::tellAboutProprietaryModules($o) if !$clicked; + + install_any::getHds($o, $o); } sub ask_mntpoint_s { @@ -233,8 +244,6 @@ sub ask_mntpoint_s { sub doPartitionDisks { my ($o) = @_; - install_any::getHds($o, $o); - if (arch() =~ /ppc/ && detect_devices::get_mac_generation() =~ /NewWorld/) { #- need to make bootstrap part if NewWorld machine - thx Pixel ;^) if (defined $partition_table::mac::bootstrap_part) { #- don't do anything if we've got the bootstrap setup @@ -254,17 +263,7 @@ sub doPartitionDisks { } } - if ($o->{isUpgrade}) { - # either one root is defined (and all is ok), or we take the first one we find - my $p = fsedit::get_root_($o->{fstab}); - if (!$p) { - my @l = install_any::find_root_parts($o->{fstab}, $o->{prefix}) or die N("No root partition found to perform an upgrade"); - $p = $o->ask_from_listf(N("Root Partition"), - N("What is the root partition (/) of your system?"), - \&partition_table::description, \@l) or die "setstep exitInstall\n"; - } - install_any::use_root_part($o->{all_hds}, $p, $o->{prefix}); - } else { + if (!$o->{isUpgrade}) { install_interactive::partitionWizard($o); } } |