From 1f62beedf81f47538f0610a8f5cd7e4f52f2dca1 Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Tue, 5 Jun 2001 16:45:48 +0000 Subject: fixed non ejection of cdrom at end of install, cleaned regexp used. --- perl-install/install_any.pm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index bcd30e39d..6dba93a48 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -85,7 +85,7 @@ sub errorOpeningFile($) { my $max = 32; #- always refuse after $max tries. if ($::o->{method} eq "cdrom") { - cat_("/proc/mounts") =~ m,(/(?:dev|tmp)/\S+)\s+/tmp/image, and $cdrom = $1; + cat_("/proc/mounts") =~ m,(/(?:dev|tmp)/\S+)\s+(?:/mnt/cdrom|/tmp/image), and $cdrom = $1; return unless $cdrom; ejectCdrom($cdrom); while ($max > 0 && askChangeMedium($::o->{method}, $asked_medium)) { @@ -457,14 +457,12 @@ sub hdInstallPath() { sub unlockCdrom(;$) { my ($cdrom) = @_; - $cdrom or cat_("/proc/mounts") =~ m|(/tmp/\S+)\s+/tmp/image| and $cdrom = $1; - $cdrom or cat_("/proc/mounts") =~ m|(/dev/\S+)\s+/mnt/cdrom | and $cdrom = $1; + $cdrom or cat_("/proc/mounts") =~ m,(/(?:dev|tmp)/\S+)\s+(?:/mnt/cdrom|/tmp/image), and $cdrom = $1; eval { $cdrom and ioctl detect_devices::tryOpen($1), c::CDROM_LOCKDOOR(), 0 }; } sub ejectCdrom(;$) { my ($cdrom) = @_; - $cdrom or cat_("/proc/mounts") =~ m|(/tmp/\S+)\s+/tmp/image| and $cdrom = $1; - $cdrom or cat_("/proc/mounts") =~ m|(/dev/\S+)\s+/mnt/cdrom | and $cdrom = $1; + $cdrom or cat_("/proc/mounts") =~ m,(/(?:dev|tmp)/\S+)\s+(?:/mnt/cdrom|/tmp/image), and $cdrom = $1; my $f = eval { $cdrom && detect_devices::tryOpen($cdrom) } or return; getFile("XXX"); #- close still opened filehandle eval { fs::umount("/tmp/image") }; -- cgit v1.2.1