summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-07-08 17:50:31 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-07-08 17:50:31 +0000
commit3b4566be852a5319345f960917a6881da44c2bd3 (patch)
tree3c9b166ca677584f88d23f4112a8d04e33420c80
parent94d8015dad4fe9ad0d574bd142a67d39b05d218b (diff)
downloadurpmi-3b4566be852a5319345f960917a6881da44c2bd3.tar
urpmi-3b4566be852a5319345f960917a6881da44c2bd3.tar.gz
urpmi-3b4566be852a5319345f960917a6881da44c2bd3.tar.bz2
urpmi-3b4566be852a5319345f960917a6881da44c2bd3.tar.xz
urpmi-3b4566be852a5319345f960917a6881da44c2bd3.zip
- compute $blist->{list} first url instead of having it in $blist->{url}
- create file_or_synthesis_dir_from_blist() and use it
-rw-r--r--urpm/cdrom.pm2
-rw-r--r--urpm/removable.pm19
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;