diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-09-22 06:01:24 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-09-22 06:01:24 +0000 |
commit | bd7a458f95f84e02e5132f2b92878f8bc0f0bfc7 (patch) | |
tree | 9504a1cefbb1941bd3c9d25a96ce78c7c566e973 /perl-install | |
parent | 7bffa077fb41248026271f640e006f4b4690e1d9 (diff) | |
download | drakx-backup-do-not-use-bd7a458f95f84e02e5132f2b92878f8bc0f0bfc7.tar drakx-backup-do-not-use-bd7a458f95f84e02e5132f2b92878f8bc0f0bfc7.tar.gz drakx-backup-do-not-use-bd7a458f95f84e02e5132f2b92878f8bc0f0bfc7.tar.bz2 drakx-backup-do-not-use-bd7a458f95f84e02e5132f2b92878f8bc0f0bfc7.tar.xz drakx-backup-do-not-use-bd7a458f95f84e02e5132f2b92878f8bc0f0bfc7.zip |
More CDÂrom mountpoint flexibility
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/pkgs.pm | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index b133611d0..e80497d5f 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -896,6 +896,8 @@ sub selectPackagesToUpgrade { sub allowedToUpgrade { $_[0] !~ /^(kernel|kernel22|kernel2.2|kernel-secure|kernel-smp|kernel-linus|kernel-linus2.2|hackkernel|kernel-enterprise)$/ } +sub supplCDMountPoint { $::o->{mainmethod} eq 'cdrom' ? "/tmp/image" : "/mnt/cdrom" } + sub installTransactionClosure { my ($packages, $id2pkg) = @_; my ($id, %closure, @l, $medium, $min_id, $max_id); @@ -933,6 +935,7 @@ sub installTransactionClosure { #- Supplementary CD : switch temporarily to "cdrom" method my $suppl_CD = isSupplCDMedium($medium); + $::o->{mainmethod} = $::o->{method}; local $::o->{method} = do { my $cdrom; cat_("/proc/mounts") =~ m,(/(?:dev|tmp)/\S+)\s+(?:/mnt/cdrom|/tmp/image), and $cdrom = $1; @@ -940,19 +943,19 @@ sub installTransactionClosure { (my $cdromdev) = detect_devices::cdroms(); $cdrom = $cdromdev->{device}; log::l("cdrom redetected at $cdrom"); - my $dev = devices::make($cdrom); - install_any::ejectCdrom($cdrom) if $::o->{method} eq 'cdrom'; # will umount /tmp/image - install_any::mountCdrom("/mnt/cdrom", $cdrom); + devices::make($cdrom); + install_any::ejectCdrom($cdrom) if $::o->{method} eq 'cdrom'; + install_any::mountCdrom(supplCDMountPoint(), $cdrom); } else { log::l("cdrom already found at $cdrom") } 'cdrom'; } if $suppl_CD; #- it is sure at least one package will be installed according to medium chosen. install_any::useMedium($medium->{medium}); - if ($medium->{method} eq 'cdrom') { + if (install_any::method_allows_medium_change($medium->{method})) { my $pkg = $packages->{depslist}[$l[0]]; #- force changeCD callback to be called from main process. - install_any::getFile($pkg->filename, $medium->{descr}, $suppl_CD ? '/mnt/cdrom' : undef); + install_any::getFile($pkg->filename, $medium->{descr}, $suppl_CD ? supplCDMountPoint() : undef); #- close opened handle above. install_any::getFile('XXX'); } @@ -1109,12 +1112,11 @@ sub install($$$;$$) { my $medium = packageMedium($packages, $pkg); my $f = $pkg && $pkg->filename; print $LOG "$f\n"; - #if (isSupplCDMedium($medium)) { - # #- supplementary CD already mounted in /mnt/cdrom - # $fd = install_any::getFile($f, $medium->{descr}, '/mnt/cdrom'); - #} else { - $fd = install_any::getFile($f, $medium->{descr}); - #} + if (isSupplCDMedium($medium)) { + $fd = install_any::getFile($f, $medium->{descr}, supplCDMountPoint()); + } else { + $fd = install_any::getFile($f, $medium->{descr}, $medium->{prefix}); + } $fd ? fileno $fd : -1; }, callback_close => sub { my ($data, $_type, $id) = @_; |