summaryrefslogtreecommitdiffstats
path: root/urpm
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 /urpm
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
Diffstat (limited to 'urpm')
-rw-r--r--urpm/mirrors.pm6
1 files changed, 5 insertions, 1 deletions
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) : '');
}