From a61523abb8b2349273dc97916a2737d63aa83a81 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Tue, 8 Mar 2005 11:12:37 +0000 Subject: Fix addition of media with passwords --- urpm.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/urpm.pm b/urpm.pm index 7f2cfc32..8fb716bc 100644 --- a/urpm.pm +++ b/urpm.pm @@ -676,7 +676,8 @@ sub add_medium { } #- check whether a password is visible, if not, set clear_url. - $url =~ m|([^:]*://[^/:\@]*:)[^/:\@]*(\@.*)| or $medium->{clear_url} = $url; + my $has_password = $url =~ m|([^:]*://[^/:\@]*:)[^/:\@]*(\@.*)|; + $medium->{clear_url} = $url unless $has_password; $with_hdlist and $medium->{with_hdlist} = $with_hdlist; @@ -695,6 +696,11 @@ sub add_medium { $_->{name} eq $name and $_->{modified} = 1 foreach @{$urpm->{media}}; $urpm->{modified} = 1; } + if ($has_password) { + foreach (grep { $_->{name} eq $name } @{$urpm->{media}}) { + $_->{url} = $url; + } + } $name; } -- cgit v1.2.1