summaryrefslogtreecommitdiffstats
path: root/urpm.pm
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 /urpm.pm
parent891195e5e9f15d971c50a46f5be4675a8f0226d4 (diff)
downloadurpmi-1718edaef5b1999f85b90370b740ead8f2d50181.tar
urpmi-1718edaef5b1999f85b90370b740ead8f2d50181.tar.gz
urpmi-1718edaef5b1999f85b90370b740ead8f2d50181.tar.bz2
urpmi-1718edaef5b1999f85b90370b740ead8f2d50181.tar.xz
urpmi-1718edaef5b1999f85b90370b740ead8f2d50181.zip
4.2-26mdk
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm18
1 files changed, 12 insertions, 6 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}));
}