diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-03-11 14:29:42 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-03-11 14:29:42 +0000 |
commit | bf81740eea5d5e354bb8de76e6505d1d5b3af3dd (patch) | |
tree | 901363f28783c04c5d1b96f23161819a15e501f0 /urpm/cdrom.pm | |
parent | 766ff34cae51aaba217851a184c0f91530fbc16d (diff) | |
download | urpmi-bf81740eea5d5e354bb8de76e6505d1d5b3af3dd.tar urpmi-bf81740eea5d5e354bb8de76e6505d1d5b3af3dd.tar.gz urpmi-bf81740eea5d5e354bb8de76e6505d1d5b3af3dd.tar.bz2 urpmi-bf81740eea5d5e354bb8de76e6505d1d5b3af3dd.tar.xz urpmi-bf81740eea5d5e354bb8de76e6505d1d5b3af3dd.zip |
- urpmi:
o have a nicer error message when perl-Hal-Cdroms is missing (#38778)
Diffstat (limited to 'urpm/cdrom.pm')
-rw-r--r-- | urpm/cdrom.pm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/urpm/cdrom.pm b/urpm/cdrom.pm index a2b2e7c8..385ac978 100644 --- a/urpm/cdrom.pm +++ b/urpm/cdrom.pm @@ -63,7 +63,8 @@ sub _try_mounting_cdrom_using_hal { $urpm->{cdrom_mounted} = {}; # reset - require Hal::Cdroms; + eval { require Hal::Cdroms; 1 } or $urpm->{error}(N("you must mount cdrom or install perl-Hal-Cdroms to have it done automatically")), return(); + my $hal_cdroms = Hal::Cdroms->new; foreach my $hal_path ($hal_cdroms->list) { my $mntpoint; @@ -121,7 +122,8 @@ sub _eject_cdrom { my $mntpoint = delete $urpm->{cdrom_mounted}{$hal_path}; $urpm->{debug} and $urpm->{debug}("umounting and ejecting $mntpoint (cdrom $hal_path)"); - require Hal::Cdroms; + eval { require Hal::Cdroms; 1 } or return; + my $hal_cdroms = Hal::Cdroms->new; $hal_cdroms->unmount($hal_path) or do { my $mntpoint = $hal_cdroms->get_mount_point($hal_path); |