summaryrefslogtreecommitdiffstats
path: root/urpm/removable.pm
diff options
context:
space:
mode:
Diffstat (limited to 'urpm/removable.pm')
-rw-r--r--urpm/removable.pm9
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}}) {