summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@mandriva.com>2010-05-11 13:18:47 +0000
committerChristophe Fergeau <cfergeau@mandriva.com>2010-05-11 13:18:47 +0000
commitf0f770bd124359a28ca04f3f4f83d552903c6f64 (patch)
tree83193361cde2bff65ea551ee4e87ebea1a5faa3b
parent90c49434f0f59cf629bebcbc8565230df89b64f7 (diff)
downloadurpmi-f0f770bd124359a28ca04f3f4f83d552903c6f64.tar
urpmi-f0f770bd124359a28ca04f3f4f83d552903c6f64.tar.gz
urpmi-f0f770bd124359a28ca04f3f4f83d552903c6f64.tar.bz2
urpmi-f0f770bd124359a28ca04f3f4f83d552903c6f64.tar.xz
urpmi-f0f770bd124359a28ca04f3f4f83d552903c6f64.zip
remember which media local packages came from
It's sometimes possible that a package is available from both a local medium (CDROM) and a distant one. This causes problems when the package isn't signed with the same key (this is bad but happens on MES5 install CDs) as urpmi tends to get confused about where a package comes from and then check the package against the wrong key. Packages are assigned IDs by urpmi, and these IDs are used to figure out the package media. This ID is also used as an identifier to "recognize" identical packages coming from different media, so we need to be careful when manipulating it. In particular, we can't assign the right ID to every package right away because then this would break package downloading (we'd download packages available on local media). When processing packages to download, if we encounter a local package, we assign it the right ID. This assumes the list of media in the blist are sorted by order of relevance (ie prioritary ones first).
-rw-r--r--NEWS2
-rw-r--r--urpm/get_pkgs.pm7
2 files changed, 8 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index e1a01b1d..100a8c34 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,8 @@
-urpmi:
o when using --update, allow package dependencies to be fetched from
non-update media (#51268)
+ o don't confuse media/media keys when a package is available from different
+ media (eg CDROM/network)
- don't crash when parsing an invalid media.cfg file in
/etc/urpmi/mediacfg.d
- fix being unable to run a second transaction set in rpmdrake (#54842)
diff --git a/urpm/get_pkgs.pm b/urpm/get_pkgs.pm
index 635df9c9..391bd152 100644
--- a/urpm/get_pkgs.pm
+++ b/urpm/get_pkgs.pm
@@ -203,7 +203,12 @@ sub download_packages_of_distant_media {
#- examine all files to know what can be indexed on multiple 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;
+ if (defined $sources->{$id}) {
+ $new_sources{$id} = [ $pkg->id, $sources->{$id} ];
+ delete $sources->{$id};
+ 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));