diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-02-26 21:10:50 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-02-26 21:10:50 +0000 |
commit | 2a5ffabe87c528f604c961635fe442b19b20fe30 (patch) | |
tree | 10fd85deb301217f8851badc0b1111c78c68c8a9 /urpm/removable.pm | |
parent | 5f8f3f148428f10ba2f177038715e195f627ee1b (diff) | |
download | urpmi-2a5ffabe87c528f604c961635fe442b19b20fe30.tar urpmi-2a5ffabe87c528f604c961635fe442b19b20fe30.tar.gz urpmi-2a5ffabe87c528f604c961635fe442b19b20fe30.tar.bz2 urpmi-2a5ffabe87c528f604c961635fe442b19b20fe30.tar.xz urpmi-2a5ffabe87c528f604c961635fe442b19b20fe30.zip |
simplify: reduce_pathname is only useful/needed for find_mntpoints
Diffstat (limited to 'urpm/removable.pm')
-rw-r--r-- | urpm/removable.pm | 5 |
1 files 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); } |