From 8c944c1d668d153c7ca500940d638cfd91a726a9 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 19 Mar 2008 16:04:38 +0000 Subject: - urpmi: o fix getting rpms from different media on same DVD without it $blist->{medium}{mntpoint} is set during first _find_blist_url_matching() and "$blist->{medium}{mntpoint} and next" will block everything. with this commit, it won't copy rpms on disk even if on different media if same DVD. --- urpm/cdrom.pm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'urpm') diff --git a/urpm/cdrom.pm b/urpm/cdrom.pm index 5f351a42..55e26671 100644 --- a/urpm/cdrom.pm +++ b/urpm/cdrom.pm @@ -85,8 +85,7 @@ sub _mount_cdrom_and_check { my ($urpm, $blists) = @_; my @matching_blists = try_mounting_cdrom($urpm, $blists) or return; - my @checked = grep { !_check_notfound($_) } @matching_blists; - $checked[0]; + grep { !_check_notfound($_) } @matching_blists; } #- side-effects: none @@ -148,8 +147,8 @@ sub _mount_cdrom { #- everything that might be necessary. while (1) { - if (my $blist = _mount_cdrom_and_check($urpm, $blists)) { - return $blist; + if (my @blists = _mount_cdrom_and_check($urpm, $blists)) { + return @blists; } # ask for the first one, it's ok if the user insert another wanted cdrom @@ -230,11 +229,12 @@ sub copy_packages_of_removable_media { $prev_medium and delete $prev_medium->{mntpoint}; _may_eject_cdrom($urpm); - my $blist = _mount_cdrom($urpm, $blists, $o_ask_for_medium); - @$blists = grep { $_ != $blist } @$blists; - - _copy_from_cdrom__if_needed($urpm, $blist, $sources, @$blists > 0); - $prev_medium = $blist->{medium}; + my @blists_mounted = _mount_cdrom($urpm, $blists, $o_ask_for_medium); + @$blists = difference2($blists, \@blists_mounted); + foreach my $blist (@blists_mounted) { + _copy_from_cdrom__if_needed($urpm, $blist, $sources, @$blists > 0); + $prev_medium = $blist->{medium}; + } } 1; -- cgit v1.2.1