diff options
-rw-r--r-- | urpm/cdrom.pm | 2 | ||||
-rw-r--r-- | urpm/removable.pm | 19 |
2 files changed, 17 insertions, 4 deletions
diff --git a/urpm/cdrom.pm b/urpm/cdrom.pm index c09c55a2..6fcfe9f7 100644 --- a/urpm/cdrom.pm +++ b/urpm/cdrom.pm @@ -21,7 +21,7 @@ sub _find_blist_url_matching { # set it, then verify $blist->{medium}{mntpoint} = $mntpoint; - if (-r urpm::removable::file_or_synthesis_dir($blist->{medium}, $blist->{url})) { + if (-r urpm::removable::file_or_synthesis_dir_from_blist($blist)) { $urpm->{log}("found cdrom $blist->{medium}{name} mounted in $mntpoint"); push @l, $blist; } else { diff --git a/urpm/removable.pm b/urpm/removable.pm index 6e392ddd..558e95a6 100644 --- a/urpm/removable.pm +++ b/urpm/removable.pm @@ -17,6 +17,12 @@ sub file_or_synthesis_dir { file_from_local_medium($medium, $o_url); } +sub file_or_synthesis_dir_from_blist { + my ($blist) = @_; + + file_or_synthesis_dir($blist->{medium}, _blist_first_url($blist)); +} + #- side-effects: #- + those of try_mounting_medium_ ($medium->{mntpoint}) sub try_mounting_medium { @@ -135,7 +141,7 @@ sub try_mounting_non_cdroms { my $blists = create_blists($urpm->{media}, $list); foreach my $blist (grep { urpm::file_from_local_url($_->{medium}{url}) } @$blists) { - try_mounting_medium($urpm, $blist->{medium}, $blist->{url}); + try_mounting_medium($urpm, $blist->{medium}, _blist_first_url($blist)); } } @@ -150,9 +156,16 @@ sub create_blists { my $i; [ map { my $list = $list->[$i++]; - my ($url) = values %$list; # first url - $url ? { medium => $_, list => $list, url => $url } : (); + %$list ? { medium => $_, list => $list } : (); } @$media ]; } +#- side-effects: none +sub _blist_first_url { + my ($blist) = @_; + + my ($url) = values %{$blist->{list}}; + $url; +} + 1; |