summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-09-01 16:08:31 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-09-01 16:08:31 +0000
commitbf1ef92e9493db31da55338ff721a765a1379982 (patch)
tree5c199515b2c48da3b397af6cb5d12735b5e35312 /urpm
parentdcda7d7bfe85823619e1c8c677553911feca092e (diff)
downloadurpmi-bf1ef92e9493db31da55338ff721a765a1379982.tar
urpmi-bf1ef92e9493db31da55338ff721a765a1379982.tar.gz
urpmi-bf1ef92e9493db31da55338ff721a765a1379982.tar.bz2
urpmi-bf1ef92e9493db31da55338ff721a765a1379982.tar.xz
urpmi-bf1ef92e9493db31da55338ff721a765a1379982.zip
- urpmi.addmedia
o handle $URPMI_ADDMEDIA_REASON (special reason to give to api.mandriva.com/mirrors/... to allow statistics)
Diffstat (limited to 'urpm')
-rw-r--r--urpm/mirrors.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/urpm/mirrors.pm b/urpm/mirrors.pm
index 29e30894..90be27b3 100644
--- a/urpm/mirrors.pm
+++ b/urpm/mirrors.pm
@@ -248,13 +248,16 @@ sub _mandriva_mirrorlist {
my $product_type = lc($product_id->{type}); $product_id =~ s/\s//g;
my $arch = $o_arch || $product_id->{arch};
- "http://api.mandriva.com/mirrors/$product_type.$product_id->{version}.$arch.list";
+ my @para = grep { $_ } $ENV{URPMI_ADDMEDIA_REASON};
+
+ "http://api.mandriva.com/mirrors/$product_type.$product_id->{version}.$arch.list"
+ . (@para ? '?' . join(',', @para) : '');
}
#- heuristic to detect wether it is really a mirrorlist or a simple mirror url:
sub _is_only_one_mirror {
my ($mirrorlist) = @_;
- _expand($mirrorlist) !~ /\.list$/;
+ _expand($mirrorlist) !~ /\.list(\?|$)/;
}
sub _network_mtime() { (stat('/etc/resolv.conf'))[9] }