From 24d3d1e9799a6a44a390f72b57e146809a8a00a8 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 29 Feb 2008 17:04:58 +0000 Subject: HAL can fail to umount the cdrom if it was not mounted by HAL. in that case, use "umount" command directly. --- urpm/cdrom.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/urpm/cdrom.pm b/urpm/cdrom.pm index ccbd29dd..c40cd320 100644 --- a/urpm/cdrom.pm +++ b/urpm/cdrom.pm @@ -124,7 +124,12 @@ sub _eject_cdrom { require Hal::Cdroms; my $hal_cdroms = Hal::Cdroms->new; - $hal_cdroms->unmount($hal_path); + $hal_cdroms->unmount($hal_path) or do { + my $mntpoint = $hal_cdroms->get_mount_point($hal_path); + #- trying harder. needed when the cdrom was not mounted by hal + $mntpoint && system("umount '$mntpoint' 2>/dev/null") == 0 + or $urpm->{error}("failed to umount $hal_path: $hal_cdroms->{error}"); + }; $hal_cdroms->eject($hal_path); 1; } -- cgit v1.2.1