summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--urpm.pm8
1 files changed, 7 insertions, 1 deletions
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;
}