summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2003-02-28 21:52:45 +0000
committerFrancois Pons <fpons@mandriva.com>2003-02-28 21:52:45 +0000
commit1718edaef5b1999f85b90370b740ead8f2d50181 (patch)
tree27cb64700027da3ef51d56f7732b3bb8a58aeb9e
parent891195e5e9f15d971c50a46f5be4675a8f0226d4 (diff)
downloadurpmi-1718edaef5b1999f85b90370b740ead8f2d50181.tar
urpmi-1718edaef5b1999f85b90370b740ead8f2d50181.tar.gz
urpmi-1718edaef5b1999f85b90370b740ead8f2d50181.tar.bz2
urpmi-1718edaef5b1999f85b90370b740ead8f2d50181.tar.xz
urpmi-1718edaef5b1999f85b90370b740ead8f2d50181.zip
4.2-26mdk
-rw-r--r--urpm.pm18
-rw-r--r--urpmi.spec6
2 files changed, 17 insertions, 7 deletions
diff --git a/urpm.pm b/urpm.pm
index cc14dcee..0ddce2ed 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -2125,7 +2125,7 @@ sub get_source_packages {
closedir D;
foreach my $medium (@{$urpm->{media} || []}) {
- my %sources;
+ my (%sources, %list_examined, $list_warning);
if (defined $medium->{start} && defined $medium->{end} && !$medium->{ignore}) {
#- always prefer a list file is available.
@@ -2139,7 +2139,7 @@ sub get_source_packages {
} elsif (keys(%{$file2fullnames{$filename} || {}}) == 1) {
my ($fullname) = keys(%{$file2fullnames{$filename} || {}});
defined($id = $fullname2id{$fullname}) and $sources{$id} = $_;
- $examined{$fullname} = undef;
+ $list_examined{$fullname} = $examined{$fullname} = undef;
}
} else {
chomp;
@@ -2150,7 +2150,8 @@ sub get_source_packages {
}
}
close F;
- } elsif (defined $medium->{url}) {
+ }
+ if (defined $medium->{url}) {
foreach ($medium->{start} .. $medium->{end}) {
my $pkg = $urpm->{depslist}[$_];
my ($filename) = $pkg->filename =~ /([^\/]*)\.rpm$/;
@@ -2159,11 +2160,16 @@ sub get_source_packages {
next;
} elsif (keys(%{$file2fullnames{$filename} || {}}) == 1) {
my ($fullname) = keys(%{$file2fullnames{$filename} || {}});
- defined($id = $fullname2id{$fullname}) and $sources{$id} = "$medium->{url}/".$pkg->filename;
- $examined{$fullname} = undef;
+ unless (exists $list_examined{$fullname}) {
+ ++$list_warning;
+ defined($id = $fullname2id{$fullname}) and $sources{$id} = "$medium->{url}/".$pkg->filename;
+ $examined{$fullname} = undef;
+ }
}
}
- } else {
+ $list_warning && $medium->{list} && -r "$urpm->{statedir}/$medium->{list}" and
+ $urpm->{error}(_("medium \"%s\" use an invalid list file (mirror is problably not up-to-date, trying to use alternate method)", $medium->{name}));
+ } elsif (!%list_examined) {
$error = 1;
$urpm->{error}(_("medium \"%s\" does not define any location for rpm files", $medium->{name}));
}
diff --git a/urpmi.spec b/urpmi.spec
index 3c31564d..a18deb4c 100644
--- a/urpmi.spec
+++ b/urpmi.spec
@@ -2,7 +2,7 @@
Name: urpmi
Version: 4.2
-Release: 25mdk
+Release: 26mdk
License: GPL
Source0: %{name}.tar.bz2
Source1: %{name}.logrotate
@@ -206,6 +206,10 @@ fi
%changelog
+* Fri Feb 28 2003 Pons François <fpons@mandrakesoft.com> 4.2-26mdk
+- added sanity check of list file used (fix bug 2110 by providing
+ a reason why there could be download error).
+
* Fri Feb 28 2003 François Pons <fpons@mandrakesoft.com> 4.2-25mdk
- fixed callback behaviour for rpmdrake.