summaryrefslogtreecommitdiffstats
path: root/urpm/media.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-02-26 22:15:01 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-02-26 22:15:01 +0000
commitc44f8c40c4a6ff9bf60ed7b54e88244a79ba2cec (patch)
treeb2da6dc7c776492676551c367356dd18b2a3afdc /urpm/media.pm
parent35ed07395593b5e85aaa16289218d09df1af868d (diff)
downloadurpmi-c44f8c40c4a6ff9bf60ed7b54e88244a79ba2cec.tar
urpmi-c44f8c40c4a6ff9bf60ed7b54e88244a79ba2cec.tar.gz
urpmi-c44f8c40c4a6ff9bf60ed7b54e88244a79ba2cec.tar.bz2
urpmi-c44f8c40c4a6ff9bf60ed7b54e88244a79ba2cec.tar.xz
urpmi-c44f8c40c4a6ff9bf60ed7b54e88244a79ba2cec.zip
- since find_mntpoints doesn't really return a list, make it clear
- return a struct instead of using %info + returned value
Diffstat (limited to 'urpm/media.pm')
-rw-r--r--urpm/media.pm14
1 files changed, 4 insertions, 10 deletions
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}));
}