summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-10-14 18:10:10 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-10-14 18:10:10 +0000
commit450c06da61da2eaed8211403087fbd9f0374db85 (patch)
tree569293216f2875d78be373a12176e562c8aa1d11
parent2e77323a8efb1fd7869bb69746d7b1d048ceb58e (diff)
downloadurpmi-450c06da61da2eaed8211403087fbd9f0374db85.tar
urpmi-450c06da61da2eaed8211403087fbd9f0374db85.tar.gz
urpmi-450c06da61da2eaed8211403087fbd9f0374db85.tar.bz2
urpmi-450c06da61da2eaed8211403087fbd9f0374db85.tar.xz
urpmi-450c06da61da2eaed8211403087fbd9f0374db85.zip
- library:
o allow mdkapplet-upgrade-helper to force $MIRRORLIST distro version
-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) : '');
}