diff options
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | urpm/mirrors.pm | 7 |
2 files changed, 8 insertions, 2 deletions
@@ -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] } |