From 5b1af8af3ee6402d07e3eff77ce412db735e2690 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 20 Nov 2006 14:39:56 +0000 Subject: - remove code handling remote "list" files (we don't support it anymore) - cleanup --- urpm.pm | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) (limited to 'urpm.pm') diff --git a/urpm.pm b/urpm.pm index 021a5744..2d8d896e 100644 --- a/urpm.pm +++ b/urpm.pm @@ -2425,18 +2425,9 @@ sub get_source_packages { if (is_valid_medium($medium) && !$medium->{ignore}) { #- always prefer a list file if available. - my $listfile = $medium->{list} ? statedir_list($urpm, $medium) : ''; - if (!$listfile && $medium->{virtual}) { - my $dir = file_from_local_url($medium->{url}); - my $with_hdlist_dir = reduce_pathname($dir . ($medium->{with_hdlist} ? "/$medium->{with_hdlist}" : "/..")); - my $local_list = 'list' . _hdlist_suffix($medium); - $listfile = reduce_pathname("$with_hdlist_dir/../$local_list"); - -s $listfile or $listfile = "$dir/list"; - } - if ($listfile && -r $listfile) { - if (my $fh = $urpm->open_safe('<', $listfile)) { - local $_; - while (<$fh>) { + if ($medium->{list}) { + if (-r statedir_list($urpm, $medium)) { + foreach (cat_(statedir_list($urpm, $medium))) { chomp; if (my ($filename) = m!([^/]*\.rpm)$!) { if (keys(%{$file2fullnames{$filename} || {}}) > 1) { @@ -2458,13 +2449,13 @@ sub get_source_packages { last; } } + } else { + # list file exists but isn't readable + # report error only if no result found, list files are only readable by root + push @list_error, N("unable to access list file of \"%s\", medium ignored", $medium->{name}); + $< and push @list_error, " " . N("(retry as root?)"); + next; } - } elsif ($listfile && -e $listfile) { - # list file exists but isn't readable - # report error only if no result found, list files are only readable by root - push @list_error, N("unable to access list file of \"%s\", medium ignored", $medium->{name}); - $< and push @list_error, " " . N("(retry as root?)"); - next; } if (defined $medium->{url}) { foreach ($medium->{start} .. $medium->{end}) { -- cgit v1.2.1