From c44f8c40c4a6ff9bf60ed7b54e88244a79ba2cec Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 26 Feb 2008 22:15:01 +0000 Subject: - since find_mntpoints doesn't really return a list, make it clear - return a struct instead of using %info + returned value --- urpm/media.pm | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'urpm/media.pm') diff --git a/urpm/media.pm b/urpm/media.pm index 6aff6977..2e8abb70 100644 --- a/urpm/media.pm +++ b/urpm/media.pm @@ -403,20 +403,14 @@ sub probe_removable_device { #- try to find device to open/close for removable medium. if (my $dir = file_from_local_url($medium->{url})) { - my %infos; - my @mntpoints = urpm::sys::find_mntpoints($dir, \%infos); - if (@mntpoints > 1) { #- return value is suitable for an hash. - $urpm->{log}(N("too many mount points for removable medium \"%s\"", $medium->{name})); - $urpm->{log}(N("taking removable device as \"%s\"", join ',', map { $infos{$_}{device} } @mntpoints)); - } if (urpm::removable::is_iso($medium->{removable})) { $urpm->{log}(N("Medium \"%s\" is an ISO image, will be mounted on-the-fly", $medium->{name})); - } elsif (@mntpoints) { - if ($medium->{removable} && $medium->{removable} ne $infos{$mntpoints[-1]}{device}) { + } elsif (my $entry = urpm::sys::find_a_mntpoint($dir)) { + if ($medium->{removable} && $medium->{removable} ne $entry->{device}) { $urpm->{log}(N("using different removable device [%s] for \"%s\"", - $infos{$mntpoints[-1]}{device}, $medium->{name})); + $entry->{device}, $medium->{name})); } - $medium->{removable} = $infos{$mntpoints[-1]}{device}; + $medium->{removable} = $entry->{device}; } else { $urpm->{error}(N("unable to retrieve pathname for removable medium \"%s\"", $medium->{name})); } -- cgit v1.2.1