summaryrefslogtreecommitdiffstats
path: root/perl-install/install_any.pm
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-04-13 13:23:52 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-04-13 13:23:52 +0000
commit794d95e5ee8251db0282ced9a390279549612b80 (patch)
tree1ea6254dc5e915ade485845921c81d7b63b63a8f /perl-install/install_any.pm
parent882f11361e45833a36d64b044af903529a40a1a3 (diff)
downloaddrakx-794d95e5ee8251db0282ced9a390279549612b80.tar
drakx-794d95e5ee8251db0282ced9a390279549612b80.tar.gz
drakx-794d95e5ee8251db0282ced9a390279549612b80.tar.bz2
drakx-794d95e5ee8251db0282ced9a390279549612b80.tar.xz
drakx-794d95e5ee8251db0282ced9a390279549612b80.zip
Eject CD-Rom when installation is finished
Diffstat (limited to 'perl-install/install_any.pm')
-rw-r--r--perl-install/install_any.pm14
1 files changed, 11 insertions, 3 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index 26ad0865d..e7e951dd5 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -937,11 +937,19 @@ sub ejectCdrom {
my ($o_cdrom, $o_mountpoint) = @_;
getFile("XXX"); #- close still opened filehandle
my $cdrom;
+ my $mounts = cat_("/proc/mounts");
if ($o_mountpoint) {
- $cdrom = $o_cdrom || cat_("/proc/mounts") =~ m!(/dev/\S+)\s+(/mnt/cdrom|/tmp/image)! && $1;
+ $cdrom = $o_cdrom || $mounts =~ m!(/dev/\S+)\s+(/mnt/cdrom|/tmp/image)! && $1;
} else {
- $cdrom = cat_("/proc/mounts") =~ m!((?:/dev/)?$o_cdrom)\s+(/mnt/cdrom|/tmp/image)! && $1;
- $o_mountpoint ||= $cdrom ? $2 || '/tmp/image' : '';
+ my $mntpt;
+ if ($o_cdrom) {
+ $cdrom = $mounts =~ m!((?:/dev/)?$o_cdrom)\s+(/mnt/cdrom|/tmp/image)! && $1;
+ $mntpt = $2;
+ } else {
+ $cdrom = $mounts =~ m!(/dev/\S+)\s+(/mnt/cdrom|/tmp/image)! && $1;
+ $mntpt = $2;
+ }
+ $o_mountpoint ||= $cdrom ? $mntpt || '/tmp/image' : '';
}
$cdrom ||= $o_cdrom;