From 2a5ffabe87c528f604c961635fe442b19b20fe30 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 26 Feb 2008 21:10:50 +0000 Subject: simplify: reduce_pathname is only useful/needed for find_mntpoints --- urpm/removable.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/urpm/removable.pm b/urpm/removable.pm index e119f103..b4a9af28 100644 --- a/urpm/removable.pm +++ b/urpm/removable.pm @@ -27,7 +27,7 @@ sub try_mounting { #- note: for isos, we don't parse the fstab because it might not be declared in it. #- so we try to remove suffixes from the dir name until the dir exists ? ($dir = urpm::sys::trim_until_d($dir)) - : _non_mounted_mntpoints($dir = reduce_pathname($dir)); + : _non_mounted_mntpoints($dir); foreach (@mntpoints) { $urpm->{log}(N("mounting %s", $_)); @@ -49,7 +49,6 @@ sub try_mounting { sub try_umounting { my ($urpm, $dir) = @_; - $dir = reduce_pathname($dir); foreach (reverse _mounted_mntpoints($dir)) { $urpm->{log}(N("unmounting %s", $_)); sys_log("umount $_"); @@ -63,12 +62,14 @@ sub try_umounting { sub _mounted_mntpoints { my ($dir) = @_; my %infos; + $dir = reduce_pathname($dir); grep { $infos{$_}{mounted} } urpm::sys::find_mntpoints($dir, \%infos); } #- side-effects: none sub _non_mounted_mntpoints { my ($dir) = @_; my %infos; + $dir = reduce_pathname($dir); grep { !$infos{$_}{mounted} } urpm::sys::find_mntpoints($dir, \%infos); } -- cgit v1.2.1