summaryrefslogtreecommitdiffstats
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
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)
-rw-r--r--NEWS3
-rw-r--r--urpm/mirrors.pm7
2 files changed, 8 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 79de063d..31c0509d 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,9 @@
- urpmi.addmedia
o instead of discarding --update when using --distrib, give it a meaning:
only add media flagged "update"
+ o handle $URPMI_ADDMEDIA_REASON
+ (special reason to give to api.mandriva.com/mirrors/... to allow statistics)
+
- gurpmi2
o nicer default window size
o render nicely under matchbox during install
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] }