summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-11-20 14:39:56 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-11-20 14:39:56 +0000
commit5b1af8af3ee6402d07e3eff77ce412db735e2690 (patch)
treeec62f102c4f3094019e5ae811d3616ad75c9d7d3
parentca59555e1697ecd3aa7e11ee3d182b24ff1c23c6 (diff)
downloadurpmi-5b1af8af3ee6402d07e3eff77ce412db735e2690.tar
urpmi-5b1af8af3ee6402d07e3eff77ce412db735e2690.tar.gz
urpmi-5b1af8af3ee6402d07e3eff77ce412db735e2690.tar.bz2
urpmi-5b1af8af3ee6402d07e3eff77ce412db735e2690.tar.xz
urpmi-5b1af8af3ee6402d07e3eff77ce412db735e2690.zip
- remove code handling remote "list" files (we don't support it anymore)
- cleanup
-rw-r--r--urpm.pm27
1 files changed, 9 insertions, 18 deletions
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}) {