From 45e873af37a0d2389feb0f5dcccba71408775956 Mon Sep 17 00:00:00 2001 From: Florent Villard Date: Sat, 5 Feb 2005 03:48:50 +0000 Subject: fix copy_rpms_on_disks --- perl-install/install_any.pm | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'perl-install') diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index 7af953dfb..1715f64fa 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -620,8 +620,10 @@ sub copy_rpms_on_disk { if ($method =~ /-iso$/) { $r = install_any::changeIso($name); } else { - ejectCdrom(); - $r &&= $o->ask_okcancel('', N("Change your Cd-Rom! + cat_("/proc/mounts") =~ m,(/dev/\S+)\s+(/mnt/cdrom|/tmp/image), + and ($cdrom, my $mountpoint) = ($1, $2); + ejectCdrom($cdrom, $mountpoint); + $r = $o->ask_okcancel('', N("Change your Cd-Rom! Please insert the Cd-Rom labelled \"%s\" in your drive and press Ok when done.", $name), 1); } return $r; @@ -631,8 +633,14 @@ Please insert the Cd-Rom labelled \"%s\" in your drive and press Ok when done.", }; foreach my $k (pkgs::allMediums($o->{packages})) { my $m = $o->{packages}{mediums}{$k}; - askChangeMedium($o->{method}, $m->{descr}) - or next; + if ($k != $current_medium) { + do { + askChangeMedium($o->{method}, $k) + or next; + mountCdrom("/tmp/image", $cdrom) + } while (!-d "/tmp/image/$m->{rpmsdir}"); + $current_medium = $k + } log::l("copying /tmp/image/$m->{rpmsdir} to $o->{prefix}/var/ftp/pub/Mandrakelinux/media"); my $wait_w = $o->wait_message(N("Please wait"), N("Copying in progress")); eval { cp_af("/tmp/image/$m->{rpmsdir}", "$o->{prefix}/var/ftp/pub/Mandrakelinux/media") }; @@ -643,6 +651,8 @@ Please insert the Cd-Rom labelled \"%s\" in your drive and press Ok when done.", } #- now the install will continue as 'disk' $o->{method} = 'disk'; + #- shoud be enough to fool errorOpeningFile + $current_medium = 1; our $copied_rpms_on_disk = 1; } -- cgit v1.2.1