summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--urpm/sys.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/urpm/sys.pm b/urpm/sys.pm
index 3b542eec..11c7604f 100644
--- a/urpm/sys.pm
+++ b/urpm/sys.pm
@@ -103,6 +103,12 @@ sub first_free_loopdev () {
sub trim_until_d {
my ($dir) = @_;
+ open my $mounts, '/proc/mounts' or do { warn "Can't read /proc/mounts: $!\n"; return $dir };
+ local *_;
+ while (<$mounts>) {
+ #- fail if an iso is already mounted
+ m!^/dev/loop! and return $dir;
+ }
while ($dir && !-d $dir) { $dir =~ s,/[^/]*$,, }
$dir;
}