summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--urpm/mirrors.pm6
2 files changed, 7 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index d8ac5df4..3a83a481 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,8 @@
o do not use --max-file-not-found=3 when downloading rpms
(since rpms are "versioned")
o use it even if nearest mirror is rsync
+- library:
+ o allow mdkapplet-upgrade-helper to force $MIRRORLIST distro version
Version 6.16 - 8 October 2008
diff --git a/urpm/mirrors.pm b/urpm/mirrors.pm
index 37a06b40..0ea9b58f 100644
--- a/urpm/mirrors.pm
+++ b/urpm/mirrors.pm
@@ -169,6 +169,9 @@ sub _load_cache {
$@ and $urpm->{error}("failed to read " . cache_file($urpm) . ": $@");
$_->{nb_uses} = 0 foreach values %$cache;
}
+ if ($ENV{URPMI_ADDMEDIA_PRODUCT_VERSION} && delete $cache->{'$MIRRORLIST'}) {
+ $urpm->{log}('not using cached mirror list $MIRRORLIST since URPMI_ADDMEDIA_PRODUCT_VERSION is set');
+ }
$cache || {};
}
sub _save_cache {
@@ -283,8 +286,9 @@ sub _mandriva_mirrorlist {
my $arch = $o_arch || $product_id->{arch};
my @para = grep { $_ } $ENV{URPMI_ADDMEDIA_REASON};
+ my $product_version = $ENV{URPMI_ADDMEDIA_PRODUCT_VERSION} || $product_id->{version};
- "http://api.mandriva.com/mirrors/$product_type.$product_id->{version}.$arch.list"
+ "http://api.mandriva.com/mirrors/$product_type.$product_version.$arch.list"
. (@para ? '?' . join('&', @para) : '');
}