diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-09-22 09:07:44 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-09-22 09:07:44 +0000 |
commit | fc99e8fcd79926758c7cdee405a7fb38f7e84feb (patch) | |
tree | 75813c1cf2ed48236c5afade7d8d8982bbda076f /perl-install | |
parent | 67d371735b988a28af4f63892921421b15525c07 (diff) | |
download | drakx-backup-do-not-use-fc99e8fcd79926758c7cdee405a7fb38f7e84feb.tar drakx-backup-do-not-use-fc99e8fcd79926758c7cdee405a7fb38f7e84feb.tar.gz drakx-backup-do-not-use-fc99e8fcd79926758c7cdee405a7fb38f7e84feb.tar.bz2 drakx-backup-do-not-use-fc99e8fcd79926758c7cdee405a7fb38f7e84feb.tar.xz drakx-backup-do-not-use-fc99e8fcd79926758c7cdee405a7fb38f7e84feb.zip |
Selection of supplementary media is now a method.
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/install_any.pm | 93 |
1 files changed, 21 insertions, 72 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index b4d6686cb..65e13c91f 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -307,58 +307,32 @@ sub preConfigureTimezone { add2hash_($o->{timezone}, { UTC => $utc, ntp => $ntp }); } +sub selectSupplMedia { +} + +sub load_rate_files { + my ($o) = @_; + #- must be done after getProvides + #- if there is a supplementary media, the rpmsrate/compssUsers are overridable + pkgs::read_rpmsrate( + $o->{packages}, + getFile(-e "/tmp/rpmsrate" ? "/tmp/rpmsrate" : "Mandrake/base/rpmsrate") + ); + ($o->{compssUsers}, $o->{gtk_display_compssUsers}) = pkgs::readCompssUsers( + $o->{meta_class}, + -e '/tmp/compssUsers' ? '/tmp/compssUsers' : 'Mandrake/base/compssUsers' + ); +} + sub setPackages { my ($o, $rebuild_needed) = @_; require pkgs; if (!$o->{packages} || is_empty_array_ref($o->{packages}{depslist})) { my $cdrom; - ($o->{packages}, my $suppl_CDs) = pkgs::psUsingHdlists($o->{prefix}, $o->{method}); - - #- ask whether there are supplementary CDs - SUPPL: { - if ($suppl_CDs && !$o->{isUpgrade} - && $o->ask_yesorno('', N("Do you have a supplementary CD to install?"), 0)) - { - #- by convention, the media names for suppl. CDs match /^\d+s$/ - my $medium = '1s'; #- supplement 1 - local $::isWizard = 0; - local $o->{method} = 'cdrom'; - (my $cdromdev) = detect_devices::cdroms(); - last SUPPL if !$cdromdev; - $cdrom = $cdromdev->{device}; - my $dev = devices::make($cdrom); - ejectCdrom($cdrom); - if ($o->ask_okcancel('', N("Insert the CD"), 1)) { - mountCdrom("/mnt/cdrom", $cdrom); - log::l($@) if $@; - useMedium($medium); - my $supplmedium = pkgs::psUsingHdlist( - $o->{prefix}, # /mnt - 'cdrom', - $o->{packages}, - "hdlist$medium.cz", - $medium, - 'Mandrake/RPMS', - "Supplementary CD $medium", - 1, # selected - "/mnt/cdrom/Mandrake/base/hdlist$medium.cz", - ); - if ($supplmedium) { - log::l("read suppl hdlist"); - $supplmedium->{prefix} = "removable://mnt/cdrom"; #- pour install_urpmi - $supplmedium->{selected} = 1; - $supplmedium->{method} = 'cdrom'; - } else { - log::l("no suppl hdlist"); - } - #- TODO loop if there are several supplementary CDs - # ++$medium; $medium .= "s"; - } - } else { - $suppl_CDs = 0; - } - } + ($o->{packages}, my $suppl_method) = pkgs::psUsingHdlists($o->{prefix}, $o->{method}); + + 1 while $suppl_method = $o->selectSupplMedia($suppl_method); #- open rpm db according to right mode needed. $o->{packages}{rpmdb} ||= pkgs::rpmDbOpen($o->{prefix}, $rebuild_needed); @@ -371,37 +345,12 @@ sub setPackages { pkgs::selectPackage($o->{packages}, pkgs::packageByName($o->{packages}, 'basesystem') || die("missing basesystem package"), 1); - #- must be done after getProvides - #- if there is a supplementary CD, override the rpmsrate/compssUsers - pkgs::read_rpmsrate( - $o->{packages}, - getFile($suppl_CDs ? "/mnt/cdrom/Mandrake/base/rpmsrate" : "Mandrake/base/rpmsrate") - ); - ($o->{compssUsers}, $o->{compssUsersSorted}) = pkgs::readCompssUsers( - $o->{meta_class}, - $suppl_CDs ? "/mnt/cdrom/Mandrake/base/compssUsers" : "", - ); + load_rate_files($o); #- preselect default_packages and compssUsersChoices. setDefaultPackages($o); pkgs::selectPackage($o->{packages}, pkgs::packageByName($o->{packages}, $_) || next) foreach @{$o->{default_packages}}; - #- umount supplementary CD. Will re-ask for it later - if ($suppl_CDs) { - getFile("XXX"); #- close still opened filehandles - log::l("Umounting suppl. CD"); - eval { fs::umount("/mnt/cdrom") }; - #- re-mount CD 1 if this was a cdrom install - if ($o->{method} eq 'cdrom') { - eval { - my $dev = detect_devices::tryOpen($cdrom); - ioctl($dev, c::CDROMEJECT(), 1); - }; - $o->ask_warn('', N("Insert the CD 1 again")); - mountCdrom("/tmp/image", $cdrom); - $asked_medium = 1; - } - } } else { #- this has to be done to make sure necessary files for urpmi are #- present. |