diff options
author | Francois Pons <fpons@mandriva.com> | 2003-09-17 12:33:57 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2003-09-17 12:33:57 +0000 |
commit | a9a5e0fdfcd99e49051e169618f43ba1877748db (patch) | |
tree | 01d89999bdd4805108dd11e388ab132eff0b10f4 | |
parent | 8948fa2f1e48ef56d46e80a792e2f4faeaabf711 (diff) | |
download | urpmi-a9a5e0fdfcd99e49051e169618f43ba1877748db.tar urpmi-a9a5e0fdfcd99e49051e169618f43ba1877748db.tar.gz urpmi-a9a5e0fdfcd99e49051e169618f43ba1877748db.tar.bz2 urpmi-a9a5e0fdfcd99e49051e169618f43ba1877748db.tar.xz urpmi-a9a5e0fdfcd99e49051e169618f43ba1877748db.zip |
fixed virtual media not examining list file.
-rw-r--r-- | urpm.pm | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -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; } } |