summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2003-09-17 12:33:57 +0000
committerFrancois Pons <fpons@mandriva.com>2003-09-17 12:33:57 +0000
commita9a5e0fdfcd99e49051e169618f43ba1877748db (patch)
tree01d89999bdd4805108dd11e388ab132eff0b10f4 /urpm.pm
parent8948fa2f1e48ef56d46e80a792e2f4faeaabf711 (diff)
downloadurpmi-a9a5e0fdfcd99e49051e169618f43ba1877748db.tar
urpmi-a9a5e0fdfcd99e49051e169618f43ba1877748db.tar.gz
urpmi-a9a5e0fdfcd99e49051e169618f43ba1877748db.tar.bz2
urpmi-a9a5e0fdfcd99e49051e169618f43ba1877748db.tar.xz
urpmi-a9a5e0fdfcd99e49051e169618f43ba1877748db.zip
fixed virtual media not examining list file.
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm18
1 files changed, 13 insertions, 5 deletions
diff --git a/urpm.pm b/urpm.pm
index 6805533d..effea779 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -2544,8 +2544,16 @@ sub get_source_packages {
if (defined $medium->{start} && defined $medium->{end} && !$medium->{ignore}) {
#- always prefer a list file is available.
- if ($medium->{list} && -r "$urpm->{statedir}/$medium->{list}") {
- open F, "$urpm->{statedir}/$medium->{list}";
+ my $file = $medium->{list} && "$urpm->{statedir}/$medium->{list}";
+ if (!$file && $medium->{virtual}) {
+ my ($dir) = $medium->{url} =~ /^(?:removable[^:]*|file)?:\/(.*)/;
+ my $with_hdlist_dir = reduce_pathname($dir . ($medium->{with_hdlist} ? "/$medium->{with_hdlist}" : "/.."));
+ my $local_list = $medium->{with_hdlist} =~ /hd(list.*)\.cz2?$/ ? $1 : 'list';
+ $file = reduce_pathname("$with_hdlist_dir/../$local_list");
+ -s $file or $file = "$dir/list";
+ }
+ if (-r $file) {
+ open F, $file;
while (<F>) {
if (my ($filename) = /\/([^\/]*\.rpm)$/) {
if (keys(%{$file2fullnames{$filename} || {}}) > 1) {
@@ -2553,14 +2561,14 @@ sub get_source_packages {
next;
} elsif (keys(%{$file2fullnames{$filename} || {}}) == 1) {
my ($fullname) = keys(%{$file2fullnames{$filename} || {}});
- defined($id = $fullname2id{$fullname}) and $sources{$id} = $_;
+ defined($id = $fullname2id{$fullname}) and $sources{$id} =
+ $medium->{virtual} ? "$medium->{url}/$_" : $_;
$list_examined{$fullname} = $examined{$fullname} = undef;
}
} else {
chomp;
$error = 1;
- $urpm->{error}(N("unable to correctly parse [%s] on value \"%s\"",
- "$urpm->{statedir}/$medium->{list}", $_));
+ $urpm->{error}(N("unable to correctly parse [%s] on value \"%s\"", $file, $_));
last;
}
}