diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-02-26 19:20:02 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-02-26 19:20:02 +0000 |
commit | f1def83292058be5c38cde16ae8121aba20eade2 (patch) | |
tree | 642eee4e84b4e1baa8659c7ef3ef95f2bb51cd20 /urpm | |
parent | dec10ebdfba6eaff29a909cbb5052c74a73cfce4 (diff) | |
download | urpmi-f1def83292058be5c38cde16ae8121aba20eade2.tar urpmi-f1def83292058be5c38cde16ae8121aba20eade2.tar.gz urpmi-f1def83292058be5c38cde16ae8121aba20eade2.tar.bz2 urpmi-f1def83292058be5c38cde16ae8121aba20eade2.tar.xz urpmi-f1def83292058be5c38cde16ae8121aba20eade2.zip |
oops, fix previous "cleaning" commit, introduce _mounted_mntpoints()
Diffstat (limited to 'urpm')
-rw-r--r-- | urpm/removable.pm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/urpm/removable.pm b/urpm/removable.pm index ed5dc63f..d4a95c90 100644 --- a/urpm/removable.pm +++ b/urpm/removable.pm @@ -50,8 +50,7 @@ sub try_umounting { my ($urpm, $dir) = @_; $dir = reduce_pathname($dir); - my @l = grep { $infos{$_}{mounted} } urpm::sys::find_mntpoints($dir, {}); - foreach (reverse @l) { + foreach (reverse _mounted_mntpoints($dir)) { $urpm->{log}(N("unmounting %s", $_)); sys_log("umount $_"); system("umount '$_' 2>/dev/null"); @@ -60,6 +59,12 @@ sub try_umounting { ! -e $dir; } +sub _mounted_mntpoints { + my ($dir) = @_; + my %info; + grep { $infos{$_}{mounted} } urpm::sys::find_mntpoints($dir, \%info); +} + sub try_umounting_removables { my ($urpm) = @_; foreach (keys %{$urpm->{removable_mounted}}) { |