summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-02-27 10:46:40 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-02-27 10:46:40 +0000
commitfa9c6fa00bffb310d3358a8ea63c6566acf924e9 (patch)
tree9ffa2f1984dad08fc47b94840afde8a85e23cccb /urpm
parent6177d90a2ada2717c8d0aed687dbbdc5cad6c5dd (diff)
downloadurpmi-fa9c6fa00bffb310d3358a8ea63c6566acf924e9.tar
urpmi-fa9c6fa00bffb310d3358a8ea63c6566acf924e9.tar.gz
urpmi-fa9c6fa00bffb310d3358a8ea63c6566acf924e9.tar.bz2
urpmi-fa9c6fa00bffb310d3358a8ea63c6566acf924e9.tar.xz
urpmi-fa9c6fa00bffb310d3358a8ea63c6566acf924e9.zip
use blists to ensure we only mount media which will be used
Diffstat (limited to 'urpm')
-rw-r--r--urpm/main_loop.pm2
-rw-r--r--urpm/removable.pm6
2 files changed, 5 insertions, 3 deletions
diff --git a/urpm/main_loop.pm b/urpm/main_loop.pm
index 73d53c61..129a597a 100644
--- a/urpm/main_loop.pm
+++ b/urpm/main_loop.pm
@@ -51,7 +51,7 @@ unless ($local_sources || $list) {
my %sources = %$local_sources;
my %error_sources;
-urpm::removable::try_mounting_non_removable($urpm);
+urpm::removable::try_mounting_non_removable($urpm, $list);
$callbacks->{pre_removable} and $callbacks->{pre_removable}->();
urpm::removable::copy_packages_of_removable_media($urpm,
diff --git a/urpm/removable.pm b/urpm/removable.pm
index bb10c14b..71e8c0ff 100644
--- a/urpm/removable.pm
+++ b/urpm/removable.pm
@@ -218,9 +218,11 @@ sub _examine_removable_medium_ {
#- side-effects:
#- + those of try_mounting_ ($urpm->{removable_mounted}, "mount")
sub try_mounting_non_removable {
- my ($urpm) = @_;
+ my ($urpm, $list) = @_;
+
+ my @used_media = map { $_->{medium} } _create_blists($urpm->{media}, $list);
- foreach my $medium (grep { !$_->{removable} } @{$urpm->{media}}) {
+ foreach my $medium (grep { !$_->{removable} } @used_media) {
my $dir = file_from_local_url($medium->{url}) or next;
-e $dir || try_mounting_($urpm, $dir) or