From 2836de6057e58e1e0bf265234b0ab162100c0644 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Wed, 30 Mar 2005 09:39:00 +0000 Subject: Don't try to find ISO mountpoints if an ISO image is already mounted --- urpm/sys.pm | 6 ++++++ 1 file changed, 6 insertions(+) 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; } -- cgit v1.2.1