summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-03-30 09:39:00 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-03-30 09:39:00 +0000
commit2836de6057e58e1e0bf265234b0ab162100c0644 (patch)
tree0d4715263c35d31b4aaf4803b704386dd10af603
parentff3f52e7ce547e83075a5dfd4405730a8cf0e12e (diff)
downloadurpmi-2836de6057e58e1e0bf265234b0ab162100c0644.tar
urpmi-2836de6057e58e1e0bf265234b0ab162100c0644.tar.gz
urpmi-2836de6057e58e1e0bf265234b0ab162100c0644.tar.bz2
urpmi-2836de6057e58e1e0bf265234b0ab162100c0644.tar.xz
urpmi-2836de6057e58e1e0bf265234b0ab162100c0644.zip
Don't try to find ISO mountpoints if an ISO image is already mounted
-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;
}