summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-09-03 07:29:47 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-09-03 07:29:47 +0000
commit95de1050aa3b54be4c13ad63c5d504348b46b733 (patch)
tree4a5a8ef1ee3962203600478feb1a7a1d2c99c55f
parent8f1f0e643517fdf975fc84ac981de8d7455ad52f (diff)
downloaddrakx-95de1050aa3b54be4c13ad63c5d504348b46b733.tar
drakx-95de1050aa3b54be4c13ad63c5d504348b46b733.tar.gz
drakx-95de1050aa3b54be4c13ad63c5d504348b46b733.tar.bz2
drakx-95de1050aa3b54be4c13ad63c5d504348b46b733.tar.xz
drakx-95de1050aa3b54be4c13ad63c5d504348b46b733.zip
Umount supplementary CD immediately after having read informations on it.
-rw-r--r--perl-install/install_any.pm35
1 files changed, 19 insertions, 16 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index 5dc28a9a4..0287ea23c 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -426,6 +426,7 @@ sub selectSupplMedia {
require install_interactive;
install_interactive::upNetwork($o);
}
+ my $main_method = $o->{method};
local $o->{method} = $suppl_method;
if ($suppl_method eq 'cdrom') {
(my $cdromdev) = detect_devices::cdroms();
@@ -438,12 +439,30 @@ sub selectSupplMedia {
mountCdrom("/mnt/cdrom", $cdrom);
log::l($@) if $@;
useMedium($medium_name);
+
#- probe for an hdlists file and then look for all hdlists listed herein
eval { pkgs::psUsingHdlists($o, $suppl_method, "/mnt/cdrom/media/media_info/hdlists", $o->{packages}, '1s') };
log::l("psUsingHdlists failed: $@");
+
#- copy latest compssUsers.pl and rpmsrate somewhere locally
getAndSaveFile("/mnt/cdrom/media/media_info/compssUsers.pl", "/tmp/compssUsers.pl");
getAndSaveFile("/mnt/cdrom/media/media_info/rpmsrate", "/tmp/rpmsrate");
+
+ #- umount supplementary CD. Will re-ask for it later
+ getFile("XXX"); #- close still opened filehandles
+ log::l("Umounting suppl. CD, back to medium 1");
+ eval { fs::umount("/mnt/cdrom") };
+ #- re-mount CD 1 if this was a cdrom install
+ if ($main_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);
+ log::l($@) if $@;
+ $asked_medium = 1;
+ }
}
} else {
my $url = $o->ask_from_entry('', N("URL of the mirror?")) or return '';
@@ -533,22 +552,6 @@ sub setPackages {
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_method eq 'cdrom') {
- 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.