diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-02-29 17:04:58 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-02-29 17:04:58 +0000 |
commit | 24d3d1e9799a6a44a390f72b57e146809a8a00a8 (patch) | |
tree | ade7b360c3145c8afbe0d15eadc554be77eeae2c | |
parent | 0032345eef218f3d803ff9bc9db0a76d5e0f9be1 (diff) | |
download | urpmi-24d3d1e9799a6a44a390f72b57e146809a8a00a8.tar urpmi-24d3d1e9799a6a44a390f72b57e146809a8a00a8.tar.gz urpmi-24d3d1e9799a6a44a390f72b57e146809a8a00a8.tar.bz2 urpmi-24d3d1e9799a6a44a390f72b57e146809a8a00a8.tar.xz urpmi-24d3d1e9799a6a44a390f72b57e146809a8a00a8.zip |
HAL can fail to umount the cdrom if it was not mounted by HAL.
in that case, use "umount" command directly.
-rw-r--r-- | urpm/cdrom.pm | 7 |
1 files changed, 6 insertions, 1 deletions
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; } |