summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--urpm/get_pkgs.pm25
2 files changed, 21 insertions, 7 deletions
diff --git a/NEWS b/NEWS
index 6016bcd0..3ca99532 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+- urpmi
+ o fix issue with urpmi sometimes using the wrong key when checking
+ signatures when the same package is available from different media
- urpmi_rpm-find-leaves
o do not list suggested packages as unrequested packages (#46326)
diff --git a/urpm/get_pkgs.pm b/urpm/get_pkgs.pm
index 9fb81b83..adf776d4 100644
--- a/urpm/get_pkgs.pm
+++ b/urpm/get_pkgs.pm
@@ -170,6 +170,7 @@ sub download_packages_of_distant_media {
my ($urpm, $blists, $sources, $error_sources, %options) = @_;
my %errors;
+ my %new_sources;
#- get back all ftp and http accessible rpm files into the local cache
foreach my $blist (@$blists) {
@@ -179,10 +180,11 @@ sub download_packages_of_distant_media {
while (my ($id, $pkg) = each %{$blist->{pkgs}}) {
#- the given URL is trusted, so the file can safely be ignored.
defined $sources->{$id} and next;
+ exists $new_sources{$id} and next;
if (urpm::is_local_medium($blist->{medium})) {
my $local_file = file_from_local_url(urpm::blist_pkg_to_url($blist, $pkg));
if (-r $local_file) {
- $sources->{$id} = $local_file;
+ $new_sources{$id} = [ $pkg->id, $local_file ];
} else {
$errors{$id} = [ $local_file, 'missing' ];
}
@@ -192,12 +194,19 @@ sub download_packages_of_distant_media {
}
if (%{$blist_distant{pkgs}}) {
- _download_packages_of_distant_media($urpm, $sources, \%errors, \%blist_distant, %options);
+ my ($remote_sources, $remote_errors) = _download_packages_of_distant_media($urpm, \%blist_distant, %options);
+ put_in_hash (\%new_sources, $remote_sources);
+ put_in_hash (\%errors, $remote_errors);
}
}
#- clean failed download which have succeeded.
- delete @errors{keys %$sources};
+ delete @errors{keys %$sources, keys %new_sources};
+
+ foreach (values %new_sources) {
+ my ($id, $local_file) = @$_;
+ $sources->{$id} = $local_file;
+ }
push @$error_sources, values %errors;
@@ -206,9 +215,10 @@ sub download_packages_of_distant_media {
sub _download_packages_of_distant_media {
- my ($urpm, $sources, $errors, $blist, %options) = @_;
+ my ($urpm, $blist, %options) = @_;
my $cachedir = urpm::valid_cachedir($urpm);
+ my (%sources, %errors);
$urpm->{log}(N("retrieving rpm files from medium \"%s\"...", $blist->{medium}{name}));
if (urpm::download::sync_rel($urpm, $blist->{medium}, [ urpm::blist_to_filenames($blist) ],
@@ -232,14 +242,15 @@ sub _download_packages_of_distant_media {
my $url = urpm::blist_pkg_to_url($blist, $pkg);
if ($filename && -s "$cachedir/partial/$filename") {
if (my $rpm = verify_partial_rpm_and_move($urpm, $cachedir, $filename)) {
- $sources->{$id} = $rpm;
+ $sources{$id} = [ $pkg->id, $rpm ];
} else {
- $errors->{$id} = [ $url, 'bad' ];
+ $errors{$id} = [ $url, 'bad' ];
}
} else {
- $errors->{$id} = [ $url, 'missing' ];
+ $errors{$id} = [ $url, 'missing' ];
}
}
+ (\%sources, \%errors)
}
1;